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.

Handling of double-quoted Descriptions in SDL

See original GitHub issue

Hi! Maybe I am missing something, but I am getting errors when trying to run snowflaqe --generate off of a more-or-less standard HotChocolate schema.graphql file. There are a number of directives and scalars at the end of the schema file, preceded with comments:

"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`."
directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT

"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions."
directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR

"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`."
directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! "Streamed when true." if: Boolean!) on FIELD

"The `DateTime` scalar represents an ISO-8601 compliant date time type."
scalar DateTime @specifiedBy(url: "https:\/\/www.graphql-scalars.com\/date-time")

"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1."
scalar Long

The first error I get is

Syntax Error GraphQL (628:1) Unexpected String "The `@defer` directive..."

As far as I understand, those are just Descriptions according to the spec. If I remove them, however, I get the following error:

Expected Name, found String "If this argument label has a value other than null, it will be passed ...

From what I can see in this thread: https://github.com/ChilliCream/hotchocolate/issues/4147#issuecomment-908129090, this SDL is as expected.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Zaid-Ajajcommented, Apr 19, 2022

Thanks @Yakimych for looking into this. I will look for a fix when time permits 😄

0reactions
Yakimychcommented, Apr 21, 2022

@Zaid-Ajaj We’ve bumped the GraphQL-dotnet package and it seems to have fixed the problem. A PR coming up tonight: https://github.com/danielstarck/Snowflaqe/tree/update-package

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphQL Schema Definition Language - SDL
Triple "double quotes" allow you to add line breaks for clearer formatting of lengthier comments. """ I'm a block description.
Read more >
Style Guide: Structure Pages
Structure pages should provide basic information about the SDL structures to allow users to most effectively utilize them in their projects. General Guidelines ......
Read more >
Schema definition language (SDL) - GraphQL Tutorials
To do that, the SDL lets you add descriptions to both types and fields by writing strings (in quotation marks) directly above them....
Read more >
Measurable Scenario Description Language Reference
Using the Measurable Scenario Description Language (M-SDL), ... String types hold a sequence of ASCII characters enclosed in double quotes.
Read more >
How To Make A Game #10 : Input Handling in C++ And SDL2 ...
How to handle keyboard input using C++ and SDL2 to move our player around the map. Don't forget to like a subscribe to...
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