graphql-zeus
graphql-zeus copied to clipboard
Gql() variables are not type-safe
While playing with the new changes introduced in v5, I noticed that Apollo queries and mutations variables can now be made typesafe by using the typedGql helper (as documented here).
However, I noticed that the barebone version of using the Gql function isn't type-safe. Is it a known limitation?
From the examples (https://github.com/graphql-editor/graphql-zeus/blob/master/examples/typescript-node/src/index.ts#L241-L273):
const aliasedQueryExecute = await Gql('query')(
{
listCards: {
__alias: {
namy: {
name: true,
},
atak: {
attack: [
{ cardID: $('cardIds', '[String!]!') },
{
name: true,
__alias: {
bbb: {
Defense: true,
},
ccc: {
Children: true,
},
},
},
],
},
},
id: true,
},
},
{
variables: {
cardIds: ['aaa'],
},
},
);
It is using the $() function and providing a graphql type but I can pass any data to cardIds without any type error.
Possible duplicate of #232 (???)
No this is a different topic.