You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,29 @@
1
1
graphql-compose-relay
2
2
======================
3
-
This is a plugin for `graphql-compose`, which wraps GraphQL types with Relay specific things, like `Node` type and interface, `globalId`, `clientMutationId`.
3
+
This is a plugin for [graphql-compose](https://github.com/nodkz/graphql-compose), which wraps GraphQL types with Relay specific things, like `Node` type and interface, `globalId`, `clientMutationId`.
`TypeComposer` is a [graphql-compose](https://github.com/nodkz/graphql-compose) utility, that wraps GraphQL types and provide bunch of useful methods for type manipulation.
// If passed RootQuery, then will be added only `node` field to this type.
19
+
// Via RootQuery.node you may find objects by globally unique ID among all types.
20
+
composeWithRelay(rootQueryTypeComposer);
21
+
22
+
// Other types, like User, will be wrapped with middlewares that:
23
+
// - add relay's id field. Field will be added or wrapped to return Relay's globally unique ID.
24
+
// - for mutations will be added clientMutationId to input and output objects types
25
+
// - this type will be added to NodeInterface for resolving via RootQuery.node
26
+
composeWithRelay(userTypeComposer);
15
27
```
16
28
That's all!
17
29
@@ -27,8 +39,6 @@ Method `composeWithRelay` accept `TypeComposer` as input argument. So `TypeCompo
27
39
28
40
If something is missing `composeWithRelay` throws error.
29
41
30
-
`TypeComposer` is [graphql-compose](https://github.com/nodkz/graphql-compose) utility, that wraps GraphQL type and provide bunch of useful methods for type manipulation.
0 commit comments