Closed sebsto closed 1 year ago
Hi @sebsto, thanks for opening this issue. It looks like the library is not compatible with the latest Amplify CLI provisioning of the list query. The investigation can be followed here: aws-amplify/amplify-cli#8350 The workaround right now may be to downgrade to use the provisioning done by the CLI before 5.0.2 which will generate a different list query name that the library is aligned on.
my workaround at the moment is to comment out the .pluralize()
call at line 19 here
https://github.com/aws-amplify/amplify-ios/blob/v1.14.0/AmplifyPlugins/Core/AWSPluginsCore/Model/Support/ModelSchema%2BGraphQL.swift#L19
An easier way to bypass this is to set the feature flag to false
The feature flag to turn off this pluralization is features.graphqltransformer.improvepluralization in your project's amplify/cli.json file.
https://github.com/aws-amplify/amplify-cli/issues/8350#issuecomment-933757747
Please use Amplify CLI 12.4.0 or greater to get the fix for the pluralization issue
Describe the bug
Hello team,
I am following instructions provided by the Amplify iOS tutorial here
I am running into a strange error with the GraphQL API.
This call in the iOS app
Amplify.API.query(request: .list(NoteData.self)) { event in ...
causes this errorerror GraphQL service returned a successful response containing errors: [Amplify.GraphQLError(message: "Validation error of type FieldUndefined: Field \'listNoteDatas\' in type \'Query\' is undefined @ \'listNoteDatas\'", locations: Optional([Amplify.GraphQLError.Location(line: 2, column: 3)]), path: nil, extensions: nil)]
Notice the
listNoteDatas
has an extra “s” at the end. The query, as seen from AppSync console, does not have that and it works in the console.The schema is
I am testing with Amplify CLI 6.1.0 on macOS I think this is a regression from Amplify 5.x
Amplify API Plugin 1.14.0
Steps To Reproduce
Steps to reproduce the behavior:
Write a function to query all notes
Build and Run
Expected behavior
The query should return all notes
Amplify Framework Version
1.14.0
Amplify Categories
API
Dependency manager
Cocoapods
Swift version
5.5
CLI version
6.1.0
Xcode version
13
Relevant log output
Is this a regression? (i.e. was this working before a version upgrade)
Yes.
Device
iOS Simulator
iOS Version
15
Specific to simulators
No response
Additional context
No response