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
44 changes: 44 additions & 0 deletions spec/Appendix A -- Persisted Documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,50 @@ 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

DocumentIdentifier ::

- PrefixedDocumentIdentifier
- CustomDocumentIdentifier

PrefixedDocumentIdentifier ::

- Sha256HexDocumentIdentifier
- OtherPrefixedDocumentIdentifier

Sha256HexDocumentIdentifier :: `sha256:` LowerCaseHexDigit+

LowerCaseHexDigit :: one of

- `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`
- `a` `b` `c` `d` `e` `f`

OtherPrefixedDocumentIdentifier :: `x-` UnreservedCharacter+ `:`
UnreservedCharacter+
martinbonnin marked this conversation as resolved.
Show resolved Hide resolved

CustomDocumentIdentifier :: 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