-
So while working with this library I realized that the generated query does not return schema type, instead it returns a completely new inline type. This is causing me some trouble as I can't determine the type and therefore, can't pass the object with type checking. Here's an example of what I mean: # Schema
type User {
id: ID!
email: String!
country: String
fullname: String
}
# Query
query User($email: String!) {
getUser(user: $user) {
id
email
fullname
}
} Given the information above the query generated for export type User = {
__typename?: 'User'
id: Scalar["ID"],
email: Scalar["String"],
country?: Maybe<Scalar["String"]>,
fullname?: Maybe<Scalar["String"]>,
}
export type UserQuery = {
__typename?: 'Query',
getUser?: {
__typename?: 'User',
id: Scalar["ID"],
email: Scalar["String"],
fullname?: Maybe<Scalar["String"]>
}
} My question is why doesn't Thanks for taking your time to help out! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
This is how GraphQL works. In operations you select specific fields so operations plugin picks those fields from schema types. |
Beta Was this translation helpful? Give feedback.
This is how GraphQL works. In operations you select specific fields so operations plugin picks those fields from schema types.