"Unknown directive model" when setting up AWS Amplify GraphQL API in WebStorm

Viewed 985
1 Answers

First, create .graphqlconfig file with the following content:

{
  "schemaPath": "schema.graphql",
  "includes": ["*"],
  "extensions": {
    "endpoints": {}
  }
}

Then, create graphql-directives.js file with the following content:

import gql from 'graphql-tag';

const clientSchemaExtensions = gql`
  directive @model on OBJECT
  scalar AWSDateTime
`;

After that, there are no syntax errors anymore!

enter image description here

This answer was adapted from this repo.

Related