TS Types do not agree with GQL Binding types
See original GitHub issueGen result from same schema:
GQL bindings:
{
where?: UserWhereInput
orderBy?: UserOrderByInput
skip?: Int
after?: String
before?: String
first?: Int
last?: Int
}
GQL Code Generator:
export interface UsersQueryArgs {
where?: UserWhereInput | null
orderBy?: UserOrderByInput | null
skip?: number | null
after?: string | null
before?: string | null
first?: number | null
last?: number | null
}
This makes resolvers harder to type because of the type mismatch (the following would type error):
users: (_, args: Schema.UsersQueryArgs, ctx, info) => {
return ctx.core.query.users(args, info)
},
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TypeScript with Apollo Client - Apollo GraphQL Docs
GraphQL uses a type system to clearly define the available data for each type and field in a GraphQL schema. Given that a...
Read more >GraphQL error handling to the max with Typescript, codegen ...
In the codegen configuration, we have defined mappers between the GraphQL schema types and the Typescript types. But this is not used at...
Read more >Graphql React Typescript error binding element 'currency ...
Error Message: Binding element 'currency' implicitly has an 'any' type. My EXCHANGE_RATES: import { ApolloClient, InMemoryCache, gql, } from "@ ...
Read more >Generated interfaces for input types should use undefined ...
Given a returned value of undefined in the interface, it is expected that the generated input will allow undefined, but it only allows...
Read more >TSConfig Reference - Docs on every TSConfig option
It is not a mechanism that prevents a file from being included in the codebase ... In TypeScript 4.0, support was added to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
haven’t been around this for a while, will do next time I am. Note there has been a new major version of GQL bindings released, of TS, so need to revisit more deeply.
@jasonkuhrt can you please try what @ardatan suggested?