Skip to content

Commit

Permalink
Update directive name to @SpecifiedBy
Browse files Browse the repository at this point in the history
  • Loading branch information
eapache authored and leebyron committed Jan 11, 2020
1 parent 084f15d commit 23d4a8f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,17 +341,17 @@ client-specific primitive for time. Another example of a potentially useful
custom scalar is `Url`, which serializes as a string, but is guaranteed by
the server to be a valid URL.

When defining an additional scalar, GraphQL systems should use the `@specified`
directive to provide a URL pointing to a human-readable specification of the
data format, serialization, and coercion rules for the scalar. For example, a
GraphQL system providing a `UUID` scalar might link to RFC 4122, or some
document defining a reasonable subset of that RFC. If a specification URL is
present, systems must conform to the described rules. Built-in scalar types
should not provide a URL.
When defining an additional scalar, GraphQL systems should use the
`@specifiedBy` directive to provide a URL pointing to a human-readable
specification of the data format, serialization, and coercion rules for the
scalar. For example, a GraphQL system providing a `UUID` scalar might link to
RFC 4122, or some document defining a reasonable subset of that RFC. If a
specification URL is present, systems must conform to the described rules.
Built-in scalar types should not provide a URL.

```graphql example
scalar UUID @specified(by: "https://tools.ietf.org/html/rfc4122")
scalar URL @specified(by: "https://tools.ietf.org/html/rfc3986")
scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122")
scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986")
```

**Built-in Scalars**
Expand Down Expand Up @@ -1759,7 +1759,7 @@ provide the `@deprecated` directive if representing deprecated portions of
the schema.

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

**Custom Directives**
Expand Down Expand Up @@ -1926,15 +1926,15 @@ type ExampleType {
```


### @specified
### @specifiedBy

```graphql
directive @specified(
by: String!
directive @specifiedBy(
url: String!
) on SCALAR
```

The `@specified` directive is used within the type system definition language
The `@specifiedBy` directive is used within the type system definition language
to provide a URL for specifying the behaviour of custom
scalar definitions. The URL should point to a human-readable specification of
the data format, serialization, and coercion rules for the scalar. For example,
Expand All @@ -1954,6 +1954,6 @@ In this example, two custom scalar types are defined with URLs pointing to the
relevant IETF specifications.

```graphql example
scalar UUID @specified(by: "https://tools.ietf.org/html/rfc4122")
scalar URL @specified(by: "https://tools.ietf.org/html/rfc3986")
scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122")
scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986")
```
2 changes: 1 addition & 1 deletion spec/Section 4 -- Introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ actually valid. These kinds are listed in the `__TypeKind` enumeration.

Represents scalar types such as Int, String, and Boolean. Scalars cannot have fields.

A GraphQL type designer should use the `@specified` directive to provide
A GraphQL type designer should use the `@specifiedBy` directive to provide
a specification URL describing the data format, serialization, and coercion
rules for the scalar. It is recommended to also summarize the format and provide
an example in the description field.
Expand Down

0 comments on commit 23d4a8f

Please sign in to comment.