# custom-scalar-specified-by

Source: https://api-genie.dev/docs/linter/graphql/rules/custom-scalar-specified-by

A rule of the GraphQL linter, which reads GraphQL schemas and operations. Since 0.9.0. In the rulesets: Strict at error, All at error.

This rule checks that custom scalars link their specification with `@specifiedBy`.

## Rule details

A custom scalar is a contract between the server and its clients; the URL of its specification tells clients how to parse and serialize it.

The rule applies to definitions. An `# apigenie-lint-disable custom-scalar-specified-by` comment on
a node turns it off for the node and everything nested in it; at the top of the file, separated from
the first definition by a blank line, the comment turns it off for the whole file.

## Examples

**Good**.

```graphql
scalar DateTime @specifiedBy(url: "https://www.rfc-editor.org/rfc/rfc3339")
```

**Bad**. The linter reports `Scalar type 'DateTime' should link its specification with @specifiedBy(url:)`.

```graphql
scalar DateTime
```
