TypeError: Cannot read property 'onType' of undefined
See original GitHub issueDescribe the bug TypeError: Cannot read property ‘onType’ of undefined
To Reproduce Steps to reproduce the behavior: codegen.yml:
schema:
- http://localhost:4000/gql
- src/gql/my-client-schema.graphql
documents: src/gql/**/*.{ts,tsx}
overwrite: true
generates:
./src/generated/gqlTypesAndComponents.tsx:
plugins:
- time
- add: "// THIS IS A GENERATED FILE, DO NOT EDIT IT!"
- typescript-common:
interfacePrefix: "I"
- typescript-client
- typescript-react-apollo
Client schema:
type AuthState {
authenticated: Boolean
token: String
}
type Query {
getAuthState: AuthState
}
type Mutation {
changeAuthState: AuthState
}
Mutations:
const SET_LOCAL_AUTH_STATE = gql`
mutation ChangeAuthState {
changeAuthState @client {
...authFragments
}
}
fragment authStateFragment on AuthState {
authenticated
token
}
Queries:
const GET_LOCAL_AUTH_STATE = gql`
query getAuthState {
getAuthState @client {
...authStateFragment
}
}
fragment authStateFragment on AuthState {
authenticated
token
}
`;
defaults on Apollo:
{
auth: {
__typename: 'AuthState',
authenticated: false,
token: null
}
}
Expected behavior To generate TS and React Components
Environment:
- OS: MacOs Mojave
- Codegen: 0.15.0
- Node: v9.11.2
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
javascript - typeerror: Cannot read properties of undefined ...
Here BoderList function maping OldList Component. But React says me typeerror: Cannot read properties of undefined (reading 'handelChangeName') ...
Read more >Uncaught TypeError: Cannot read property 'onBlur' of ... - GitHub
The onChange prop is managed by react-hook-form-auto. I will take steps to avoid the problem if that's the case. Not very important, but...
Read more >onChange script error: TypeError: Cannot read property 'value ...
When you insert an assessment template into the attestation related list of the Vendor record. We get an onChnage Client Script Error message....
Read more >How to Fix TypeError: Cannot read Property 'push' of ...
You call the method on a variable previously set to undefined . You call the method on a variable before it has been...
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
Okay. That.was.fast. Thank you!
@zenVentzi We fixed that in 1.0.7 - now you should get the error and the name of the fragments that caused that.