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

Update the specs for re-relaying #1

Merged
merged 7 commits into from
Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
3 changes: 2 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"publish-gh-pages": "docusaurus-publish",
"write-translations": "docusaurus-write-translations",
"crowdin-upload": "crowdin-cli --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-download": "crowdin-cli --config ../crowdin.yaml download -b master"
"crowdin-download": "crowdin-cli --config ../crowdin.yaml download -b master",
"update-specs":"spec-md spec/Connections.md > static/graphql/connections.htm; spec-md spec/Mutations.md > static/graphql/mutations.htm; spec-md spec/ObjectIdentification.md > static/graphql/objectidentification.htm"
},
"dependencies": {
"docusaurus": "1.6.2",
Expand Down
23 changes: 14 additions & 9 deletions website/spec/Connections.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
Relay Cursor Connections Specification
GraphQL Cursor Connections Specification
--------------------------------------

Relay's support for pagination relies on the GraphQL server exposing
connections in a standardized way. In the query, the connection model
provides a standard mechanism for slicing and paginating the result set.
This specification aims to provide options for GraphQL clients to consistently
orta marked this conversation as resolved.
Show resolved Hide resolved
handle pagination with support for related metadata via a GraphQL server. This
spec proposes calling them connections and treats pageable list in a standardized
orta marked this conversation as resolved.
Show resolved Hide resolved
way.

In the query, the connection model provides a standard mechanism for slicing
and paginating the result set.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a hard time understanding this sentence. I know you didn’t write this, but do you understand what it’s trying to convey?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's talking about always using the same args in each connection for pagination

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. before after next the_other_one

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reading further, I think they mean in the literal query text, and then what you said yeah


In the response, the connection model provides a standard way of providing
cursors, and a way of telling the client when more results are available.

Expand Down Expand Up @@ -47,16 +52,16 @@ This section of the spec describes the formal requirements around connections.

# Reserved Types

A GraphQL Relay server must reserve certain types and type names
to support the pagination model used by Relay. In particular, this spec creates
A GraphQL server which conforms to this spec must reserve certain types and type names
to support the pagination model of connections. In particular, this spec creates
guidelines for the following types:

- Any object whose name ends in "Connection".
- An object named `PageInfo`.

# Connection Types

Any type whose name ends in "Connection" is considered by Relay
Any type whose name ends in "Connection" is considered by this spec
to be a *Connection Type*. Connection types must be an "Object"
as defined in the "Type System" section of the GraphQL Specification.

Expand Down Expand Up @@ -143,7 +148,7 @@ returns
# Edge Types

A type that is returned in list form by a connection type's `edges` field
is considered by Relay to be an *Edge Type*. Edge types must be an "Object"
is considered by this spec to be an *Edge Type*. Edge types must be an "Object"
as defined in the "Type System" section of the GraphQL Specification.

## Fields
Expand Down Expand Up @@ -173,7 +178,7 @@ Non-Null wrapper around a custom scalar that serializes as a String.
Whatever type this field returns will be referred to as the *cursor type*
in the rest of this spec.

The result of this field is considered opaque by Relay, but will be passed
The result of this field is considered opaque by the spec, but will be passed
orta marked this conversation as resolved.
Show resolved Hide resolved
back to the server as described in the "Arguments" section below.

## Introspection
Expand Down
6 changes: 3 additions & 3 deletions website/spec/Mutations.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Relay Input Object Mutations Specification
Relay Classic Input Object Mutations Specification
------------------------------------------

Relay's support for mutations relies on the GraphQL server exposing
Relay Classic's support for mutations relies on the GraphQL server exposing
mutation fields in a standardized way. These mutations accept and emit a
identifier string, which allows Relay to track mutations and responses.
identifier string, which allows Relay Classic to track mutations and responses.
Copy link

@alloy alloy Jan 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this was a stated intent for Modern, the identifier string (clientMutationId) hasn't actually been removed yet. Nonetheless I'd leave this change in the upstream PR and then discuss it.


All mutations may include in their input a `clientMutationId` string, which is
then returned as part of the object returned by the mutation field.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc could probably stay in relay? it's only for relay classic now

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Expand Down
21 changes: 11 additions & 10 deletions website/spec/ObjectIdentification.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Relay Global Object Identification Specification
GraphQL Global Object Identification Specification
------------------------------------------------

Relay's support for object identification relies on the GraphQL server exposing
object identifiers in a standardized way. In the query, the schema should
provide a standard mechanism for asking for an object by ID. In the response,
the schema provides a standard way of providing these IDs.
To provide options for GraphQL clients to elegantly handle for caching and data
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is “to handle for” English?

I like adding the examples 👍

refetching GraphQL servers need to expose object identifiers in a standardized
way. In the query, the schema should provide a standard mechanism for asking
for an object by ID. In the response, the schema provides a standard way of
providing these IDs.

We refer to objects with identifiers as "nodes".

Expand All @@ -28,9 +29,9 @@ refetching.

# Reserved Types

A GraphQL Relay server must reserve certain types and type names
to support the object identification model used by Relay. In particular, this
spec creates guidelines for the following types:
A GraphQL server compatible with this spec must reserve certain types and type names
to support the consistent object identification model. In particular, this spec creates
guidelines for the following types:

- An interface named `Node`.
- The `node` field on the root query type.
Expand Down Expand Up @@ -294,15 +295,15 @@ might return:
}
```

For Relay to be able to link the usernames to the responses, it needs to
For clients to be able to link the usernames to the responses, it needs to
know that the array in the response will be the same size as the array
passed as an argument, and that the order in the response will match the
order in the argument. We call these *plural identifying root fields*, and
their requirements are described below.

## Fields

A Relay-compliant server may expose root fields that accept a list of input
A server compliant with this spec may expose root fields that accept a list of input
arguments, and returns a list of responses. For Relay to use these fields,
these fields must be *plural identifying root fields*, and obey the following
requirements.
Expand Down
Loading