Skip to content

Add identifier syntax #296

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

Open
wants to merge 9 commits into
base: persisted-documents
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions spec/Appendix A -- Persisted Documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,35 @@ 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 `:` Sha256Checksum

Sha256Checksum :: 64 LowerCaseHexDigit

LowerCaseHexDigit :: one of

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

OtherPrefixedDocumentIdentifier :: x- IdentifierCharacter+ `:` IdentifierCharacter+

CustomDocumentIdentifier :: SourceCharacter+

IdentifierCharacter :: SourceCharacter but not `:`

SourceCharacter :: "Any Unicode scalar value"

## Persisting a Document

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