arvitaly / tslint-plugin-graphql

Check your GraphQL query strings against a schema.
MIT License
17 stars 5 forks source link

Adding support for Fragment syntax #10

Open tonyxiao opened 5 years ago

tonyxiao commented 5 years ago

Checking fragment doesn't work at the moment. In particular, the linter breaks for queries and mutations which uses fragments (which is supported by graphql-tag )

image

maximeg commented 5 years ago

Same thing.

const QUERY = gql`
  query AlertListOp($state: String) {
    alerts(state: $state) {
      ...AlertListFragment
  }

  ${FRAGMENT}
`;

=> GraphQL invalid syntax: Syntax Error GraphQL (8:3) Unexpected Name "FRAGMENT"

😢