question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load schema with query parameter enum default

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
newhousecommented, Jun 21, 2022

Fixed and published under v1.2.4.

0reactions
newhousecommented, Jun 21, 2022

You’re welcome

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting default value on an enum causes the default ...
Whenever a default is set on an enum parameter it becomes impossible to send another version than the default.
Read more >
Swagger validation error when API uses enum
Status schema, query parameters in OpenAPI 2.0 cannot $ref schemas, so the enum must be defined in the status parameter directly.
Read more >
Enums as Request Parameters in Spring Boot Rest
This article is about handling enums as request parameters in spring boot rest with annotations such as @PathVariable, @RequestParam and ...
Read more >
Language Guide (proto3) | Protocol Buffers
For enums, the default value is the first defined enum value, which must be 0. For message fields, the field is not set....
Read more >
11.6 Data Type Default Values
Subqueries, parameters, variables, stored functions, and loadable functions are not permitted. An expression default value cannot depend on a column that has ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found