Unable to upload large graphql schema to aws appsync
Asked Answered
S

3

6

I am trying to upload my graphql schema to aws appsync. My graphql schema is nearly 5000 lines long. I tried uploading using cli and gui, both.

(1.) When using cli, I am continually getting error "Failed to parse schema document - ensure it's a valid SDL-formatted document."

(2.) When using gui, the pipes in all the unions in my graphql schema ( eg. union UnionType = Type1 | Type2 | Type3 ) are replaced with whitespaces, causing syntax error. After solving this by manual replacement of whitespaces, the tab becomes unresponsive, and needs to be killed.

I tried uploading a small graphql schema with a union from cli, and it worked successfully. However, from gui, it caused the same error of replacing pipes with whitespaces in union.

I need help understanding this behaviour with aws cli and aws console.

Sedgemoor answered 16/3, 2018 at 11:22 Comment(5)
How big is your schema?Chor
In terms of file size, 134KB. In terms of number of lines, upwards of 5600 lines.Sedgemoor
As to point 1, that's the 'catch all' message for a schema that the service couldn't parse. Could you share a request id, relative timestamp, and region in which you called? I can investigate further.Bifacial
Same issue here. Any solution ?Schedule
We finally ended up using github.com/sid88in/serverless-appsync-plugin , as it provided us with the flexibility of adding our graphql resolvers and everything inside the serverless.yaml file. This simplified our build process, as we are anyways using serverlessSedgemoor
B
2

I've got a similar issue and AppSync didn't allow to put any comments in it with just only one # symbol.

Make sure you have no comments with just one # and use double sharps ## Anyway, it happens you have some invalid format or syntax AppSync doesn't support yet.

Beesley answered 27/5, 2018 at 19:37 Comment(2)
This was similar for me – I commented my enum & it rejected it. Without comments in the enum, it was 100%.Film
I had sort of a combination of these two issues: comments starting with # inside of an enum were rejected, but comments starting with ## were simply ignored (they are not visible in the console editor).Prussianism
C
1

It turns out that, in our case, the problem was the existence of reserved keys defined in out schema (DynamoDB reserved words) even though we are not using Dynamo at all.

Cristie answered 21/8, 2019 at 20:27 Comment(1)
Does Query count? I see the word QUERY in the reserved list, but the docs use type Query docs.aws.amazon.com/cdk/api/latest/docs/aws-appsync-readme.html.Incus
S
0

I got a similar error when attempting to extend/implement one interface with another interface. Turns out only a type can implement an interface.

Sharpsighted answered 11/3 at 6:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.