This repository was archived by the owner on Sep 27, 2023. It is now read-only.
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
TypeError when using the @connection
directive #179
Open
Description
I ran into an issue with using the @connection
directive that is causing a typing error in the associated generated file. If I // @ts-ignore
the type error, everything functions but this seems like a poor solution for a generated file.
Query:
const query = graphql`
query chatQuery {
conversations: conversationsConnection(first: 50) @connection(key: "Chat_conversations", filters: []) {
edges {
node {
...ConversationList_conversations
}
}
}
}
`
Error from the associated generated file:
Type '{ kind: string; fragment: { kind: string; name: string; type: string; metadata: any; argumentDefinitions: { kind: string; name: string; type: string; defaultValue: any; }[]; selections: { kind: string; alias: string; ... 5 more ...; selections: ({ ...; } | { ...; })[]; }[]; }; operation: { ...; }; params: { ...; }; }' is not assignable to type 'ConcreteRequest'.
The types of 'operation.selections' are incompatible between these types.
Type '({ kind: string; alias: string; name: string; storageKey: any; args: ({ kind: string; name: string; value: number; fields?: undefined; } | { kind: string; name: string; fields: { kind: string; name: string; items: { ...; }[]; }[]; value?: undefined; })[]; ... 5 more ...; filters?: undefined; } | { ...; })[]' is not assignable to type 'readonly NormalizationSelection[]'.
Type '{ kind: string; alias: string; name: string; storageKey: any; args: ({ kind: string; name: string; value: number; fields?: undefined; } | { kind: string; name: string; fields: { kind: string; name: string; items: { ...; }[]; }[]; value?: undefined; })[]; ... 5 more ...; filters?: undefined; } | { ...; }' is not assignable to type 'NormalizationSelection'.
Type '{ kind: string; alias: string; name: string; args: ({ kind: string; name: string; value: number; fields?: undefined; } | { kind: string; name: string; fields: { kind: string; name: string; items: { kind: string; name: string; variableName: string; }[]; }[]; value?: undefined; })[]; ... 6 more ...; selections?: undef...' is not assignable to type 'NormalizationSelection'.
Type '{ kind: string; alias: string; name: string; args: ({ kind: string; name: string; value: number; fields?: undefined; } | { kind: string; name: string; fields: { kind: string; name: string; items: { kind: string; name: string; variableName: string; }[]; }[]; value?: undefined; })[]; ... 6 more ...; selections?: undef...' is not assignable to type 'NormalizationLinkedField'.
Property 'storageKey' is optional in type '{ kind: string; alias: string; name: string; args: ({ kind: string; name: string; value: number; fields?: undefined; } | { kind: string; name: string; fields: { kind: string; name: string; items: { kind: string; name: string; variableName: string; }[]; }[]; value?: undefined; })[]; ... 6 more ...; selections?: undef...' but required in type 'NormalizationLinkedField'.ts(2322)
Metadata
Metadata
Assignees
Labels
No labels