-
-
Notifications
You must be signed in to change notification settings - Fork 56
Fragment on <interface> not working #158
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
Comments
Thanks for reporting this. I haven't been able to reproduce your issue (please take a look at the referenced PR). You do seem to have an error in your fragment as well: fragment PersonSummary on IPerson {
id: ID!
} should probably be fragment PersonSummary on IPerson {
id
} Some information that might be useful to help me help you is:
|
Sorry, the schema I proved works. It happens when I am using nested fragments. interface IUser {
id: ID!
}
type User implements IUser {
id: ID!
}
type Location {
id: ID!
users: [User!]!
}
type Query {
locations: [Location!]!
}
fragment UserSummary on IUser {
id
}
fragment LocationWithUsers on Location {
id
users {
...UserSummary
}
}
query GetLocations {
locations {
...LocationWithUsers
}
} (I updated the schema on the initial post too) When the query is sent to the server, it doesn't contain all the required properties from the person summary except the When I add the fragment LocationWithUsers on Location {
id
users {
id
...UserSummary
}
} |
I have a feeling this comment could be the issue zino-hofmann/graphql-flutter#994 (comment) |
So is this a problem with the data not being sent to/from your server on runtime, or the built serialisers? |
The query that gets sent to the server doesn't contain the required information like |
This library shouldn’t be manipulating your queries, can you elaborate a
bit on what you mean by
query that gets sent to the server doesn't contain the required
information
…On Tue, 9 Aug 2022 at 16:22, Sander Jochems ***@***.***> wrote:
The query that gets sent to the server doesn't contain the required
information like users.id
—
Reply to this email directly, view it on GitHub
<#158 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2UFSZESTT64FI7UHYOYIDVYJSTHANCNFSM556QSKAQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The query that should get sent to the server is query GetLocations {
locations {
__typename
users {
__typename
id
}
}
} But the query that is sent is query GetLocations {
locations {
__typename
users {
__typename
}
}
} |
Cheers. The library does no such changes to queries. Please make sure you've rebuild your serialisers. If this doesn't work please share the generated file + the original query + an example on how you're calling the query. |
I'm going to close this issue for now. Let's revisit if you have more information. |
When I am using a fragment which implements on an interface, the query doesn't get generated with that part
The text was updated successfully, but these errors were encountered: