aws-amplify / amplify-ios-samples Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT No Attribution
License: MIT No Attribution
xcode: Version 14.1 (14B47b)
amplify-cli: 10.5.2
posts cannot be fetched using this project as-is.
the schema in HEAD gives me this error:
2022-12-20 22:42:59.062248-0400 PhotoSharingSample[75767:4147505] [ProcessMutationErrorFromCloudOperation] GraphQLError missing extensions and errorType GraphQLError(message: "The variables input contains a field name \'posts\' that is not defined for input object type \'CreateUserInput\' ", locations: nil, path: nil, extensions: nil)
2022-12-20 22:42:59.062672-0400 PhotoSharingSample[75767:4147505] [Amplify] The operation couldn’t be completed. (Amplify.DataStoreError error 0.)
I tried changing the schema to:
type Post
@model
@auth(rules: [{ allow: owner, provider: userPools, operations: [read, create, update, delete] }]) {
id: ID!
postBody: String!
pictureKey: String!
createdAt: AWSDateTime!
userID: ID! @index(name: "byUser", queryField: "postByOwner")
postedBy: User! @belongsTo(fields: ["userID"])
}
type User
@model
@auth(rules: [{ allow: owner, provider: userPools, operations: [read, create, update, delete] }]) {
id: ID!
username: String!
profilePic: String!
posts: [Post] @hasMany(indexName: "byUser", fields:["id"])
}
but now i'm getting this error:
2022-12-20 23:22:30.666685-0400 PhotoSharingSample[78129:4181911] [AWSDataStorePlugin] StorageEngine completed with error: DataStoreError: One or more errors occurred syncing models. See below for detailed error description.
Recovery suggestion: DataStoreError: An error occurred syncing Post
Caused by:
DataStoreError: failed to process graphqlResponseData
Caused by:
APIError: failed to process graphqlResponseData
Caused by:
DataStoreError: The key `__typename` was not found
Recovery suggestion: Check if the parsed JSON contains the expected `__typename`
Caused by:
DataStoreError: One or more errors occurred syncing models. See below for detailed error description.
Recovery suggestion: DataStoreError: An error occurred syncing Post
Caused by:
DataStoreError: failed to process graphqlResponseData
Caused by:
APIError: failed to process graphqlResponseData
Caused by:
DataStoreError: The key `__typename` was not found
Recovery suggestion: Check if the parsed JSON contains the expected `__typename`
i'm out of my depth here as I don't know graphql schema nor DataStore nor swift. 🙏
cc @ruiguoamz
While trying to understand the relationship of all the classes etc that make auth work I came across PhotoSharingEntryView.swift, which appears to be orphaned. Is it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.