# custom-scalar-specified-by

Source: https://apigenie.pl/docs/linter/graphql/rules/custom-scalar-specified-by

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.

## Configuration

This rule has no options.

```yaml
version: "1.0"
commands:
  lint:
    graphql:
      rules:
        custom-scalar-specified-by: warning
```

The rule can be disabled for a node and everything nested in it with an `# apigenie-lint-disable custom-scalar-specified-by` comment on the node, or for a whole file with the comment at the top of the file, separated from the first definition by a blank line. It applies to definitions.

## 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
```
