Open Jaff5090 opened 1 month ago
Thank you for the detailed bug report. We'll need to try to reproduce this to see what is going on. It would be very helpful if you could share the content of your GraphQL files (feel free to just include the models in your reproduction steps).
Hi @Jaff5090,
It appears that you may be attempting to use .graphql files generated for the AWS Mobile AppSync SDK Android and not the Amplify models.
Amplify API requires Java models generated from the Amplify API schema.graphql
file, and generated via amplify codegen models
command.
Do you have an Amplify schema.graphql
file? If so, can you share what your Java models look like?
I see that you have both:
implementation("com.amazonaws:aws-android-sdk-appsync:3.4.1")
and implementation ("com.amplifyframework:aws-api:2.19.1")
. I would expect that you would be using only one of these libraries and not both.
@tylerjroach @mattcreaser Hello ,
Thank you for your feedback and the detailed bug report. Currently, I don't have access to the schema.graphql file because our team uses a shared graph schema for the project. The web app pushes changes to the API, and I only perform GET PULL API . As a result, I don't generate Java models from a schema.graphql file.
Thank you for your understanding.
Best regards,
@Jaff5090
These files were then used to generate the corresponding Java classes that allow interaction with the API.
How are you creating the Java files? Are they being created through this library? https://github.com/awslabs/aws-mobile-appsync-sdk-android
If so, you would need to use the AppSync SDK library instead of Amplify API library.
If your team is using Amplify API (and not just AppSync directly), the schema.graphql is necessary to generate the Java model files: https://docs.amplify.aws/gen1/android/build-a-backend/graphqlapi/client-code-generation/#generate-models-for-android-swift-flutter-and-javascript-datastore
Before opening, please confirm:
Language and Async Model
Kotlin
Amplify Categories
GraphQL API
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
We are working on a project where the same API is used for both a web app and a mobile app. To integrate this API into the mobile app, I used AWS Amplify with the following commands to generate the necessary configurations:
This command generated the graphqlconfig.yml file along with fragments.graphql, mutations.graphql, subscriptions.graphql, and queries.graphql files. These files were then used to generate the corresponding Java classes that allow interaction with the API.
I then used these generated classes to make API requests, specifically to retrieve a list of sessions. When I make a request to retrieve the full list of sessions, it works correctly, and I receive all available sessions.
Problem:
The issue arises when I try to filter the list of sessions using an owner field and an input of type Session. Here's an example of the query I’m using to filter
Reproduction steps (if applicable)
No response
Code Snippet
``Kotlin suspend fun getSessions(userId: String): List? {
val sessionFilterInput = ModelSessionFilterInput.builder()
.owner(ModelStringInput.builder().eq(userId).build())
.archived(ModelBooleanInput.builder().eq(false).build())
.build()
amplifyconfiguration.json
GraphQL Schema
Additional information and screenshots