Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid fields are not being caught as type errors #177

Open
tastywheat opened this issue Jun 1, 2024 · 2 comments
Open

Invalid fields are not being caught as type errors #177

tastywheat opened this issue Jun 1, 2024 · 2 comments

Comments

@tastywheat
Copy link

Adding an invalid field is not displaying an error indicator. My code:

Screen Shot 2024-06-01 at 5 35 03 PM

Graphql schema

type Query {
    article: Artcle
}
type Article {
    title: String
}
Copy link

linear bot commented Jun 1, 2024

@lukepolo
Copy link

this happens for me if a single valid things exists

 const data = await  createClient().query({
      matches: {
        asldkfasdf: true,
      }
    });
src/hasura/hasura.service.ts:29:9 - error TS2353: Object literal may only specify known properties, and 'asldkfasdf' does not exist in type 'matchesGenqlSelection & { __args?: { distinct_on?: matches_select_column[]; limit?: number; offset?: number; order_by?: matches_order_by[]; where?: matches_bool_exp; }; }'.

29         asldkfasdf: true,
           ~~~~~~~~~~

  generated/schema.ts:18019:5
    18019     matches?: (matchesGenqlSelection & { __args?: {
              ~~~~~~~
    The expected type comes from property 'matches' which is declared here on type 'query_rootGenqlSelection & { __name?: string; }'

but

     const data = await  createClient().query({
      matches: {
        id: true,
        asldkfasdf: true,
      }
    });

wont

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants