When I try to import a graphql schema file, I get:
Could not load GraphQL schema.
Syntax Error: Expected Name, found String "id".
the schema file (myschema.json) is huge, but starts like this:
{
"data": {
"__schema": {
"queryType": {
"name": "Query"
},
"mutationType": {
"name": "Mutation"
},
"subscriptionType": {
"name": "Subscription"
},
"types": [
{
"kind": "OBJECT",
"name": "Query",
"description": null,
"fields": [
{
"name": "meta",
"description": null,
"args": [],
"type": {
"kind": "OBJECT",
"name": "MetaResponse",
and ends like this:
{
"name": "aws_lambda",
"description": "Tells the service this field/object has access authorized by a Lambda Authorizer.",
"locations": [
"OBJECT",
"FIELD_DEFINITION"
],
"args": []
}
]
}
}
i am pulling the schema using this query:
query IntrospectionQuery {
__schema {
queryType {
name
}
mutationType {
name
}
subscriptionType {
name
}
types {
...FullType
}
directives {
name
description
locations
args {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
description
fields(includeDeprecated: true) {
name
description
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
description
type {
...TypeRef
}
defaultValue
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}
Ive run the schema through a json validator and it says its good.
Any ideas?