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

Support @specifiedBy for custom scalars #159

Open
stuebingerb opened this issue Jan 12, 2025 · 0 comments
Open

Support @specifiedBy for custom scalars #159

stuebingerb opened this issue Jan 12, 2025 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@stuebingerb
Copy link
Owner

From to the spec (1), https://spec.graphql.org/draft/#sec-Scalars:

When defining a custom scalar, GraphQL services should provide a scalar specification URL via the @specifiedBy directive or the specifiedByURL introspection field. This URL must link to a human-readable specification of the data format, serialization, and coercion rules for the scalar.

From the spec (2), https://spec.graphql.org/draft/#sec-Type-System.Directives.Built-in-Directives:

GraphQL implementations that support the type system definition language should provide the @specifiedBy directive if representing custom scalar definitions.

From the spec (3), https://spec.graphql.org/draft/#sec--specifiedBy:

directive @specifiedBy(url: String!) on SCALAR

Example:

scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122")
scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986")
scalar DateTime
  @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time")

The @specifiedBy built-in directive is used within the type system definition language to provide a scalar specification URL for specifying the behavior of custom scalar types. The URL should point to a human-readable specification of the data format, serialization, and coercion rules. It must not appear on built-in scalar types.

@stuebingerb stuebingerb added enhancement New feature or request good first issue Good for newcomers labels Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant