The GraphQL Spec defines that you can add a field "typename" in the query. It returns the name of the current type which can be useful for interfaces or union types.
The resolver for this field is part of graphql-java. However, in graphql-jpa, quering for "typename" resulted in an exception because the data fetcher was trying to get a JPA field with this name from the entity which obviously isn't possible.
To fix this, I've added a check in the JpaDataFetcher that ignores fields with the name "__typename".
The GraphQL Spec defines that you can add a field "typename" in the query. It returns the name of the current type which can be useful for interfaces or union types. The resolver for this field is part of graphql-java. However, in graphql-jpa, quering for "typename" resulted in an exception because the data fetcher was trying to get a JPA field with this name from the entity which obviously isn't possible.
To fix this, I've added a check in the
JpaDataFetcher
that ignores fields with the name "__typename".