New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amplify Codegen without @model directive does not create Java/Kotlin code for Queries #2807
Comments
@olliestringfield-accedo This is expected. The Amplify Android client library is built to use Amplify models and it does not use the |
@tylerjroach Thanks for the recommendation. |
@olliestringfield-accedo Can you show me a code example for Swift of what you are doing? I want to make sure I'm not misunderstanding anything. One difference between Swift and Android is that the AWS AppSync SDK for iOS has entered maintenance mode, and the Amplify API category was updated to support a few of the AppSync SDK use cases. |
So given the attached We can see the generated GetProductQuery class
Then we can use this to create a
I've added the full generated API.swift for reference |
Hi @olliestringfield-accedo, the use case you are using on the Swift side is the one found in the upgrade guide to use the AppSync SDK API.swift file that was previously used with AppSync iOS SDK. When the SDK was placed into maintenance mode, support was added on Amplify Swift side to allow this file to be used. Since the Android AppSync SDK is still supported, this migration path has not been enabled. The expectation is still to use the AppSync Android SDK. |
Thanks for the clarification @tylerjroach. I'll use the Android AppSync SDK for our use case |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Before opening, please confirm:
Language and Async Model
Kotlin - Coroutines
Amplify Categories
Authentication, GraphQL API
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
https://docs.amplify.aws/gen1/android/build-a-backend/graphqlapi/client-code-generation/
Describe the bug
We are implementing the Android Amplify SDK into a Kotlin Android app with no Amplify instance.
Instead we are using a Cognito User Pool and AppSync.
When putting the schema.graphql from AppSync into the root folder and running the codegen command:
Only
.graphql
files are generated i.eapp/src/main/graphql/com/amazonaws/amplify/generated/graphql/queries.graphql
There is no generated Java or Kotlin code to use with Amplify SDK and use our queries defined in the schema file.
Note the schema is not using the @model directive since we are not using Dynamo DB
Reproduction steps (if applicable)
No response
Code Snippet
// Put your code below this line.
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
Output
queries.graphql
The text was updated successfully, but these errors were encountered: