Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load schema with query parameter enum default #399

Closed
jamesmcglinn opened this issue Jun 19, 2022 · 5 comments · Fixed by #400
Closed

Unable to load schema with query parameter enum default #399

jamesmcglinn opened this issue Jun 19, 2022 · 5 comments · Fixed by #400
Assignees
Labels
bug Something isn't working

Comments

@jamesmcglinn
Copy link

Spectaql seems unable to parse schemas with enum query parameter defaults.

Given this schema as an example:

type Query {
  records(sorting: [RecordSort!] = [{ direction: ASC }]): [Record]!
}

type Record {
  id: ID!
  name: ID!
}

input RecordSort {
  direction: SortDirection!
}

enum SortDirection {
  ASC
  DESC
}

Spectaql fails with:

SyntaxError: JSON5: invalid character 'A' at 1:14

Putting quotes around ASC is something of a workaround, but seems wrong given it's not a String parameter.

Possibly related to #301?

@newhouse
Copy link
Collaborator

Probably not related but I'll dig in soon

@newhouse
Copy link
Collaborator

Fix is coming via #400 but other flavors of this may pop up from time-to-time.

@newhouse newhouse self-assigned this Jun 21, 2022
@newhouse newhouse added the bug Something isn't working label Jun 21, 2022
@newhouse
Copy link
Collaborator

Fixed and published under v1.2.4.

@jamesmcglinn
Copy link
Author

Thanks very much for looking at this so quickly @newhouse!

@newhouse
Copy link
Collaborator

You're welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants