【问题标题】:"Unknown directive model" when setting up AWS Amplify GraphQL API in WebStorm在 WebStorm 中设置 AWS Amplify GraphQL API 时出现“未知指令模型”
【发布时间】:2021-05-31 15:03:01
【问题描述】:
【问题讨论】:
标签:
angular
amazon-web-services
graphql
webstorm
aws-amplify
【解决方案1】:
首先,创建.graphqlconfig 文件,内容如下:
{
"schemaPath": "schema.graphql",
"includes": ["*"],
"extensions": {
"endpoints": {}
}
}
然后,创建graphql-directives.js 文件,内容如下:
import gql from 'graphql-tag';
const clientSchemaExtensions = gql`
directive @model on OBJECT
scalar AWSDateTime
`;
之后,就没有语法错误了!
这个答案改编自from this repo。