You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered a peculiar bug but it is a bit difficult to describe, so here goes.
On a query, the graphql-java library parses the data in the variables field of the input (I think using Jackson) to the correct values. For example, given the following schema
typeQuery {
bookByPageCount(pageCount: Int!): Book
}
typeBook {
id: IDname: StringpageCount: Int
}
the string "223" is parsed to an Integer by java since pageCount needs to be an Int according to the schema.
When we add a apollo federation service (using apollo-server version 2.8.1 and @apollo/gateway version 0.8.2) on top of a java service serving the above schema
What I would expect to happen instead of returning an empty json is either one of two things:
The federation service also returns the same data as the java service
The federation service returns an error telling that the variables are not according to the schema
I hope I have outlined the issue clearly. It might be that this issue is unexpected behaviour in the graphql-java library in which case I will issue a bug for that library.
The text was updated successfully, but these errors were encountered:
Thanks for bringing this to our attention @pepijno (and the wonderful reproduction!).
ApolloServer's behavior is to respond with an error about incorrect variable types (as opposed to coercion, as you mentioned Java does). It appears that gateway doesn't return that error the way that ApolloServer does, which is something that we should fix!
Hi,
Thanks for the awesome work and projects!
I discovered a peculiar bug but it is a bit difficult to describe, so here goes.
On a query, the
graphql-java
library parses the data in the variables field of the input (I think using Jackson) to the correct values. For example, given the following schemaand the following query data
the string
"223"
is parsed to an Integer by java sincepageCount
needs to be an Int according to the schema.When we add a apollo federation service (using
apollo-server
version 2.8.1 and@apollo/gateway
version 0.8.2) on top of a java service serving the above schemaand we send the same query as mentioned earlier but now to the apollo federation service we get the response
while the java service does return the correct response.
I have created a simple sample project which shows this issue: https://github.com/pepijno/apollo-federation-variables-bug
What I would expect to happen instead of returning an empty json is either one of two things:
I hope I have outlined the issue clearly. It might be that this issue is unexpected behaviour in the
graphql-java
library in which case I will issue a bug for that library.The text was updated successfully, but these errors were encountered: