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

Add identifier syntax #296

Open
wants to merge 9 commits into
base: persisted-documents
Choose a base branch
from
48 changes: 48 additions & 0 deletions spec/Appendix A -- Persisted Documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,54 @@ implementation specific.
Note: A 32 character hexadecimal _custom document identifier_ is likely to be an
MD5 hash of the GraphQL document, as traditionally used by Relay.

### Document identifier syntax

A _document identifier_ must only contain colons (`:`) and characters that are
defined as
[`unreserved` in RFC3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3)
(alphanumeric characters (`A-Z`, `a-z`, `0-9`), dashes (`-`), periods (`.`),
underscores (`_`), and tildes (`~`)).
martinbonnin marked this conversation as resolved.
Show resolved Hide resolved

DocumentIdentifier ::

- PrefixedDocumentIdentifier
- CustomDocumentIdentifier

PrefixedDocumentIdentifier ::

- Prefix `:` Payload

Prefix :: UnreservedCharacter+

Payload :: PayloadCharacter+

CustomDocumentIdentifier :: UnreservedCharacter+ [lookahead != `:`]

PayloadCharacter ::

- UnreservedCharacter
- `:`

UnreservedCharacter ::

- Letter
- Digit
- `-`
- `.`
- `_`
- `~`
martinbonnin marked this conversation as resolved.
Show resolved Hide resolved

Letter :: one of

- `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M`
- `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z`
- `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m`
- `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z`

Digit :: one of

- `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`

## Persisting a Document

To utilize persisted documents for a request, the client must possess a unique
Expand Down
Loading