This repository was archived by the owner on Oct 17, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -85,11 +85,12 @@ Here are three scenarios how this binding could be used:
85
85
86
86
Inside a Node script, you could install the ` graphql-binding-example ` via ` npm ` or ` yarn ` and then use it inside the script:
87
87
88
- <!-- Copy and Paste Me -->
88
+
89
89
<div class =" glitch-embed-wrap " style =" height : 420px ; width : 100% ;" >
90
90
<iframe src =" https://glitch.com/embed/#!/embed/gem-darkness?path=server.js&previewSize=0&sidebarCollapsed=true " alt =" gem-darkness on glitch " style =" height : 100% ; width : 100% ; border : 0 ;" ></iframe >
91
91
</div >
92
92
93
+
93
94
In this example, ` createUser ` takes two arguments:
94
95
95
96
1 . The ** arguments** for the mutation
@@ -107,13 +108,10 @@ mutation {
107
108
108
109
Similarly, you could write script that sends the ` users ` query via the invocation of a binding function:
109
110
110
- ``` js
111
- const userBinding = require (' graphql-binding-users' ).default
111
+ <div class =" glitch-embed-wrap " style =" height : 420px ; width : 100% ;" >
112
+ <iframe src =" https://glitch.com/embed/#!/embed/boulder-earwig?path=server.js&previewSize=0&sidebarCollapsed=true " alt =" boulder-earwig on glitch " style =" height : 100% ; width : 100% ; border : 0 ;" ></iframe >
113
+ </div >
112
114
113
- // Retrieve all `User`s
114
- userBinding .query .users ({}, ` { id name }` )
115
- .then (users => console .log (` Retrieved all users: ${ users} ` ))
116
- ```
117
115
118
116
This time, no arguments are being passed and the selection set asks for the ` id ` and the ` name ` of the ` User ` s being returned.
119
117
You can’t perform that action at this time.
0 commit comments