├── .flowconfig
├── .gitignore
├── LICENSE
├── README.md
├── graphql.config.json
├── package.json
├── public
├── favicon.ico
├── index.html
└── manifest.json
├── schema.graphql
├── setup.js
├── src
├── App.js
├── Environment.js
├── MainRelay.js
├── __generated__
│ └── MainRelayQuery.graphql.js
├── components
│ ├── Header.js
│ ├── UserProfile.js
│ ├── UserVisitCard.js
│ └── __generated__
│ │ ├── UserProfile_User.graphql.js
│ │ └── UserVisitCard_User.graphql.js
├── index.js
├── res
│ ├── index.css
│ ├── react_logo.svg
│ └── relay_logo.svg
└── sw
│ └── registerServiceWorker.js
└── yarn.lock
/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 | ./node_modules/fbjs/.*
3 |
4 | [libs]
5 | ./flow-typed
6 |
7 | [options]
8 | esproposal.class_static_fields=enable
9 | esproposal.class_instance_fields=enable
10 |
11 | module.name_mapper='^\(.*\)\.css$' -> 'react-scripts/config/flow/css'
12 | module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> 'react-scripts/config/flow/file'
13 |
14 | suppress_type=$FlowIssue
15 | suppress_type=$FlowFixMe
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (http://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # Typescript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | # See https://help.github.com/ignore-files/ for more about ignoring files.
61 |
62 | # dependencies
63 | /node_modules
64 |
65 | # testing
66 | /coverage
67 |
68 | # production
69 | /build
70 |
71 | # misc
72 | .DS_Store
73 | .env.local
74 | .env.development.local
75 | .env.test.local
76 | .env.production.local
77 |
78 | npm-debug.log*
79 | yarn-debug.log*
80 | yarn-error.log*
81 |
82 | # IDE
83 | /.idea
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # relay
2 | Kit para Iniciantes no Relay Modern (baseado no create-react-app)
3 |
4 | # Antes de qualquer coisa
5 | Entre no Slack do React Brasil: [https://react-brasil-slack.herokuapp.com](https://react-brasil-slack.herokuapp.com)
6 |
7 |
8 | # Como rodar
9 | ```sh
10 |
11 | yarn install
12 |
13 | # Em uma aba
14 | yarn relay
15 |
16 | # Em outra aba
17 | yarn start
18 |
19 | ```
20 |
21 | # Desafios
22 | - Mostrar a lista de usuários
23 | - Fazer com que mude o "user_id" mostrado atualmente ao clicar em um item na lista
24 | - Fazer uma chamada de mutation para editar o usuário
25 | - Abrir issues e pull-requests aqui, com melhorias para o kit de iniciantes no Relay Modern :)
26 |
27 |
28 | # Links úteis
29 | - [https://www.slideshare.net/reactconfbr/sibelius-seraphini-relay-modern](https://www.slideshare.net/reactconfbr/sibelius-seraphini-relay-modern)
30 | - [https://facebook.github.io/relay/docs/en/thinking-in-relay.html](https://facebook.github.io/relay/docs/en/thinking-in-relay.html)
31 |
--------------------------------------------------------------------------------
/graphql.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "schema": {
3 | "READ_FROM_file": "graphql.schema.json",
4 | "request": {
5 | "url" : "https://api.graph.cool/relay/v1/cjb3n7jnp0ir70184sgit9e4v",
6 | "method" : "POST",
7 | "postIntrospectionQuery" : true
8 | }
9 | },
10 | "endpoints" : [
11 | {
12 | "name": "Default (graph.cool)",
13 | "url": "https://api.graph.cool/relay/v1/cjb3n7jnp0ir70184sgit9e4v"
14 | }
15 | ]
16 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "relay",
3 | "version": "0.1.0",
4 | "private": false,
5 | "author": "nic",
6 | "contributors": [
7 | "danvitoriano",
8 | "sibelius"
9 | ],
10 | "dependencies": {
11 | "react": "^16.2.0",
12 | "react-dom": "^16.2.0",
13 | "react-relay": "^1.4.1",
14 | "relay-runtime": "^1.4.1"
15 | },
16 | "devDependencies": {
17 | "babel-plugin-relay": "^1.4.1",
18 | "react-scripts": "1.0.17",
19 | "relay-compiler": "^1.4.1"
20 | },
21 | "scripts": {
22 | "relay": "relay-compiler --src ./src --schema ./schema.graphql --watch",
23 | "start": "./setup.js && react-scripts start",
24 | "build": "./setup.js && react-scripts build",
25 | "test": "./setup.js && react-scripts test --env=jsdom",
26 | "eject": "react-scripts eject"
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nic/relay/1830c79fdd9a17f0344a849ebba9ece80c500fe3/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | React+Relay App
10 |
11 |
12 |
15 |
16 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/schema.graphql:
--------------------------------------------------------------------------------
1 | input CreateFile {
2 | name: String!
3 | }
4 |
5 | input CreateFileInput {
6 | name: String!
7 | clientMutationId: String!
8 | }
9 |
10 | type CreateFilePayload {
11 | viewer: Viewer!
12 | clientMutationId: String!
13 | file: File
14 | edge: FileEdge
15 | }
16 |
17 | input CreateUser {
18 | github: String!
19 | name: String!
20 | }
21 |
22 | # If authentication was successful the payload contains the user and a token. If unsuccessful this payload is null.
23 | type CreateUserPayload {
24 | user: User
25 | clientMutationId: String
26 | viewer: Viewer!
27 | }
28 |
29 | scalar DateTime
30 |
31 | input DeleteFileInput {
32 | id: ID!
33 | clientMutationId: String!
34 | }
35 |
36 | type DeleteFilePayload {
37 | viewer: Viewer!
38 | clientMutationId: String!
39 | file: File
40 | edge: FileEdge
41 | deletedId: ID
42 | }
43 |
44 | input DeleteUserInput {
45 | id: ID!
46 | clientMutationId: String!
47 | }
48 |
49 | type DeleteUserPayload {
50 | viewer: Viewer!
51 | clientMutationId: String!
52 | user: User
53 | edge: UserEdge
54 | deletedId: ID
55 | }
56 |
57 | type File implements Node {
58 | contentType: String!
59 | createdAt: DateTime!
60 | id: ID!
61 | name: String!
62 | secret: String!
63 | size: Int!
64 | updatedAt: DateTime!
65 | url: String!
66 | }
67 |
68 | # A connection to a list of items.
69 | type FileConnection {
70 | # Information to aid in pagination.
71 | pageInfo: PageInfo!
72 |
73 | # A list of edges.
74 | edges: [FileEdge]
75 |
76 | # Count of filtered result set without considering pagination arguments
77 | count: Int!
78 | }
79 |
80 | # An edge in a connection.
81 | type FileEdge {
82 | # The item at the end of the edge.
83 | node: File!
84 |
85 | # A cursor for use in pagination.
86 | cursor: String!
87 | }
88 |
89 | input FileFilter {
90 | # Logical AND on all given filters.
91 | AND: [FileFilter!]
92 |
93 | # Logical OR on all given filters.
94 | OR: [FileFilter!]
95 | contentType: String
96 |
97 | # All values that are not equal to given value.
98 | contentType_not: String
99 |
100 | # All values that are contained in given list.
101 | contentType_in: [String!]
102 |
103 | # All values that are not contained in given list.
104 | contentType_not_in: [String!]
105 |
106 | # All values less than the given value.
107 | contentType_lt: String
108 |
109 | # All values less than or equal the given value.
110 | contentType_lte: String
111 |
112 | # All values greater than the given value.
113 | contentType_gt: String
114 |
115 | # All values greater than or equal the given value.
116 | contentType_gte: String
117 |
118 | # All values containing the given string.
119 | contentType_contains: String
120 |
121 | # All values not containing the given string.
122 | contentType_not_contains: String
123 |
124 | # All values starting with the given string.
125 | contentType_starts_with: String
126 |
127 | # All values not starting with the given string.
128 | contentType_not_starts_with: String
129 |
130 | # All values ending with the given string.
131 | contentType_ends_with: String
132 |
133 | # All values not ending with the given string.
134 | contentType_not_ends_with: String
135 | createdAt: DateTime
136 |
137 | # All values that are not equal to given value.
138 | createdAt_not: DateTime
139 |
140 | # All values that are contained in given list.
141 | createdAt_in: [DateTime!]
142 |
143 | # All values that are not contained in given list.
144 | createdAt_not_in: [DateTime!]
145 |
146 | # All values less than the given value.
147 | createdAt_lt: DateTime
148 |
149 | # All values less than or equal the given value.
150 | createdAt_lte: DateTime
151 |
152 | # All values greater than the given value.
153 | createdAt_gt: DateTime
154 |
155 | # All values greater than or equal the given value.
156 | createdAt_gte: DateTime
157 | id: ID
158 |
159 | # All values that are not equal to given value.
160 | id_not: ID
161 |
162 | # All values that are contained in given list.
163 | id_in: [ID!]
164 |
165 | # All values that are not contained in given list.
166 | id_not_in: [ID!]
167 |
168 | # All values less than the given value.
169 | id_lt: ID
170 |
171 | # All values less than or equal the given value.
172 | id_lte: ID
173 |
174 | # All values greater than the given value.
175 | id_gt: ID
176 |
177 | # All values greater than or equal the given value.
178 | id_gte: ID
179 |
180 | # All values containing the given string.
181 | id_contains: ID
182 |
183 | # All values not containing the given string.
184 | id_not_contains: ID
185 |
186 | # All values starting with the given string.
187 | id_starts_with: ID
188 |
189 | # All values not starting with the given string.
190 | id_not_starts_with: ID
191 |
192 | # All values ending with the given string.
193 | id_ends_with: ID
194 |
195 | # All values not ending with the given string.
196 | id_not_ends_with: ID
197 | name: String
198 |
199 | # All values that are not equal to given value.
200 | name_not: String
201 |
202 | # All values that are contained in given list.
203 | name_in: [String!]
204 |
205 | # All values that are not contained in given list.
206 | name_not_in: [String!]
207 |
208 | # All values less than the given value.
209 | name_lt: String
210 |
211 | # All values less than or equal the given value.
212 | name_lte: String
213 |
214 | # All values greater than the given value.
215 | name_gt: String
216 |
217 | # All values greater than or equal the given value.
218 | name_gte: String
219 |
220 | # All values containing the given string.
221 | name_contains: String
222 |
223 | # All values not containing the given string.
224 | name_not_contains: String
225 |
226 | # All values starting with the given string.
227 | name_starts_with: String
228 |
229 | # All values not starting with the given string.
230 | name_not_starts_with: String
231 |
232 | # All values ending with the given string.
233 | name_ends_with: String
234 |
235 | # All values not ending with the given string.
236 | name_not_ends_with: String
237 | secret: String
238 |
239 | # All values that are not equal to given value.
240 | secret_not: String
241 |
242 | # All values that are contained in given list.
243 | secret_in: [String!]
244 |
245 | # All values that are not contained in given list.
246 | secret_not_in: [String!]
247 |
248 | # All values less than the given value.
249 | secret_lt: String
250 |
251 | # All values less than or equal the given value.
252 | secret_lte: String
253 |
254 | # All values greater than the given value.
255 | secret_gt: String
256 |
257 | # All values greater than or equal the given value.
258 | secret_gte: String
259 |
260 | # All values containing the given string.
261 | secret_contains: String
262 |
263 | # All values not containing the given string.
264 | secret_not_contains: String
265 |
266 | # All values starting with the given string.
267 | secret_starts_with: String
268 |
269 | # All values not starting with the given string.
270 | secret_not_starts_with: String
271 |
272 | # All values ending with the given string.
273 | secret_ends_with: String
274 |
275 | # All values not ending with the given string.
276 | secret_not_ends_with: String
277 | size: Int
278 |
279 | # All values that are not equal to given value.
280 | size_not: Int
281 |
282 | # All values that are contained in given list.
283 | size_in: [Int!]
284 |
285 | # All values that are not contained in given list.
286 | size_not_in: [Int!]
287 |
288 | # All values less than the given value.
289 | size_lt: Int
290 |
291 | # All values less than or equal the given value.
292 | size_lte: Int
293 |
294 | # All values greater than the given value.
295 | size_gt: Int
296 |
297 | # All values greater than or equal the given value.
298 | size_gte: Int
299 | updatedAt: DateTime
300 |
301 | # All values that are not equal to given value.
302 | updatedAt_not: DateTime
303 |
304 | # All values that are contained in given list.
305 | updatedAt_in: [DateTime!]
306 |
307 | # All values that are not contained in given list.
308 | updatedAt_not_in: [DateTime!]
309 |
310 | # All values less than the given value.
311 | updatedAt_lt: DateTime
312 |
313 | # All values less than or equal the given value.
314 | updatedAt_lte: DateTime
315 |
316 | # All values greater than the given value.
317 | updatedAt_gt: DateTime
318 |
319 | # All values greater than or equal the given value.
320 | updatedAt_gte: DateTime
321 | url: String
322 |
323 | # All values that are not equal to given value.
324 | url_not: String
325 |
326 | # All values that are contained in given list.
327 | url_in: [String!]
328 |
329 | # All values that are not contained in given list.
330 | url_not_in: [String!]
331 |
332 | # All values less than the given value.
333 | url_lt: String
334 |
335 | # All values less than or equal the given value.
336 | url_lte: String
337 |
338 | # All values greater than the given value.
339 | url_gt: String
340 |
341 | # All values greater than or equal the given value.
342 | url_gte: String
343 |
344 | # All values containing the given string.
345 | url_contains: String
346 |
347 | # All values not containing the given string.
348 | url_not_contains: String
349 |
350 | # All values starting with the given string.
351 | url_starts_with: String
352 |
353 | # All values not starting with the given string.
354 | url_not_starts_with: String
355 |
356 | # All values ending with the given string.
357 | url_ends_with: String
358 |
359 | # All values not ending with the given string.
360 | url_not_ends_with: String
361 | }
362 |
363 | enum FileOrderBy {
364 | contentType_ASC
365 | contentType_DESC
366 | createdAt_ASC
367 | createdAt_DESC
368 | id_ASC
369 | id_DESC
370 | name_ASC
371 | name_DESC
372 | secret_ASC
373 | secret_DESC
374 | size_ASC
375 | size_DESC
376 | updatedAt_ASC
377 | updatedAt_DESC
378 | url_ASC
379 | url_DESC
380 | }
381 |
382 | type Mutation {
383 | createFile(input: CreateFileInput!): CreateFilePayload
384 | updateFile(input: UpdateFileInput!): UpdateFilePayload
385 | updateUser(input: UpdateUserInput!): UpdateUserPayload
386 | updateOrCreateFile(input: UpdateOrCreateFileInput!): UpdateOrCreateFilePayload
387 | updateOrCreateUser(input: UpdateOrCreateUserInput!): UpdateOrCreateUserPayload
388 | deleteFile(input: DeleteFileInput!): DeleteFilePayload
389 | deleteUser(input: DeleteUserInput!): DeleteUserPayload
390 | createUser(input: SignupUserInput!): CreateUserPayload!
391 | }
392 |
393 | # An object with an ID
394 | interface Node {
395 | # The id of the object.
396 | id: ID!
397 | }
398 |
399 | # Information about pagination in a connection.
400 | type PageInfo {
401 | # When paginating forwards, are there more items?
402 | hasNextPage: Boolean!
403 |
404 | # When paginating backwards, are there more items?
405 | hasPreviousPage: Boolean!
406 |
407 | # When paginating backwards, the cursor to continue.
408 | startCursor: String
409 |
410 | # When paginating forwards, the cursor to continue.
411 | endCursor: String
412 | }
413 |
414 | type Query {
415 | viewer: Viewer!
416 |
417 | # Fetches an object given its ID
418 | node(
419 | # The ID of an object
420 | id: ID!
421 | ): Node
422 | }
423 |
424 | input SignupUserInput {
425 | github: String!
426 | name: String!
427 | clientMutationId: String!
428 | }
429 |
430 | input UpdateFile {
431 | id: ID!
432 | name: String
433 | }
434 |
435 | input UpdateFileInput {
436 | id: ID!
437 | name: String
438 | clientMutationId: String!
439 | }
440 |
441 | type UpdateFilePayload {
442 | viewer: Viewer!
443 | clientMutationId: String!
444 | file: File
445 | edge: FileEdge
446 | }
447 |
448 | input UpdateOrCreateFileInput {
449 | update: UpdateFile!
450 | create: CreateFile!
451 | clientMutationId: String!
452 | }
453 |
454 | type UpdateOrCreateFilePayload {
455 | viewer: Viewer!
456 | clientMutationId: String!
457 | file: File
458 | edge: FileEdge
459 | }
460 |
461 | input UpdateOrCreateUserInput {
462 | update: UpdateUser!
463 | create: CreateUser!
464 | clientMutationId: String!
465 | }
466 |
467 | type UpdateOrCreateUserPayload {
468 | viewer: Viewer!
469 | clientMutationId: String!
470 | user: User
471 | edge: UserEdge
472 | }
473 |
474 | input UpdateUser {
475 | github: String
476 | id: ID!
477 | name: String
478 | }
479 |
480 | input UpdateUserInput {
481 | github: String
482 | id: ID!
483 | name: String
484 | clientMutationId: String!
485 | }
486 |
487 | type UpdateUserPayload {
488 | viewer: Viewer!
489 | clientMutationId: String!
490 | user: User
491 | edge: UserEdge
492 | }
493 |
494 | type User implements Node {
495 | createdAt: DateTime!
496 | github: String!
497 | id: ID!
498 | name: String!
499 | updatedAt: DateTime!
500 | }
501 |
502 | # A connection to a list of items.
503 | type UserConnection {
504 | # Information to aid in pagination.
505 | pageInfo: PageInfo!
506 |
507 | # A list of edges.
508 | edges: [UserEdge]
509 |
510 | # Count of filtered result set without considering pagination arguments
511 | count: Int!
512 | }
513 |
514 | # An edge in a connection.
515 | type UserEdge {
516 | # The item at the end of the edge.
517 | node: User!
518 |
519 | # A cursor for use in pagination.
520 | cursor: String!
521 | }
522 |
523 | input UserFilter {
524 | # Logical AND on all given filters.
525 | AND: [UserFilter!]
526 |
527 | # Logical OR on all given filters.
528 | OR: [UserFilter!]
529 | createdAt: DateTime
530 |
531 | # All values that are not equal to given value.
532 | createdAt_not: DateTime
533 |
534 | # All values that are contained in given list.
535 | createdAt_in: [DateTime!]
536 |
537 | # All values that are not contained in given list.
538 | createdAt_not_in: [DateTime!]
539 |
540 | # All values less than the given value.
541 | createdAt_lt: DateTime
542 |
543 | # All values less than or equal the given value.
544 | createdAt_lte: DateTime
545 |
546 | # All values greater than the given value.
547 | createdAt_gt: DateTime
548 |
549 | # All values greater than or equal the given value.
550 | createdAt_gte: DateTime
551 | github: String
552 |
553 | # All values that are not equal to given value.
554 | github_not: String
555 |
556 | # All values that are contained in given list.
557 | github_in: [String!]
558 |
559 | # All values that are not contained in given list.
560 | github_not_in: [String!]
561 |
562 | # All values less than the given value.
563 | github_lt: String
564 |
565 | # All values less than or equal the given value.
566 | github_lte: String
567 |
568 | # All values greater than the given value.
569 | github_gt: String
570 |
571 | # All values greater than or equal the given value.
572 | github_gte: String
573 |
574 | # All values containing the given string.
575 | github_contains: String
576 |
577 | # All values not containing the given string.
578 | github_not_contains: String
579 |
580 | # All values starting with the given string.
581 | github_starts_with: String
582 |
583 | # All values not starting with the given string.
584 | github_not_starts_with: String
585 |
586 | # All values ending with the given string.
587 | github_ends_with: String
588 |
589 | # All values not ending with the given string.
590 | github_not_ends_with: String
591 | id: ID
592 |
593 | # All values that are not equal to given value.
594 | id_not: ID
595 |
596 | # All values that are contained in given list.
597 | id_in: [ID!]
598 |
599 | # All values that are not contained in given list.
600 | id_not_in: [ID!]
601 |
602 | # All values less than the given value.
603 | id_lt: ID
604 |
605 | # All values less than or equal the given value.
606 | id_lte: ID
607 |
608 | # All values greater than the given value.
609 | id_gt: ID
610 |
611 | # All values greater than or equal the given value.
612 | id_gte: ID
613 |
614 | # All values containing the given string.
615 | id_contains: ID
616 |
617 | # All values not containing the given string.
618 | id_not_contains: ID
619 |
620 | # All values starting with the given string.
621 | id_starts_with: ID
622 |
623 | # All values not starting with the given string.
624 | id_not_starts_with: ID
625 |
626 | # All values ending with the given string.
627 | id_ends_with: ID
628 |
629 | # All values not ending with the given string.
630 | id_not_ends_with: ID
631 | name: String
632 |
633 | # All values that are not equal to given value.
634 | name_not: String
635 |
636 | # All values that are contained in given list.
637 | name_in: [String!]
638 |
639 | # All values that are not contained in given list.
640 | name_not_in: [String!]
641 |
642 | # All values less than the given value.
643 | name_lt: String
644 |
645 | # All values less than or equal the given value.
646 | name_lte: String
647 |
648 | # All values greater than the given value.
649 | name_gt: String
650 |
651 | # All values greater than or equal the given value.
652 | name_gte: String
653 |
654 | # All values containing the given string.
655 | name_contains: String
656 |
657 | # All values not containing the given string.
658 | name_not_contains: String
659 |
660 | # All values starting with the given string.
661 | name_starts_with: String
662 |
663 | # All values not starting with the given string.
664 | name_not_starts_with: String
665 |
666 | # All values ending with the given string.
667 | name_ends_with: String
668 |
669 | # All values not ending with the given string.
670 | name_not_ends_with: String
671 | updatedAt: DateTime
672 |
673 | # All values that are not equal to given value.
674 | updatedAt_not: DateTime
675 |
676 | # All values that are contained in given list.
677 | updatedAt_in: [DateTime!]
678 |
679 | # All values that are not contained in given list.
680 | updatedAt_not_in: [DateTime!]
681 |
682 | # All values less than the given value.
683 | updatedAt_lt: DateTime
684 |
685 | # All values less than or equal the given value.
686 | updatedAt_lte: DateTime
687 |
688 | # All values greater than the given value.
689 | updatedAt_gt: DateTime
690 |
691 | # All values greater than or equal the given value.
692 | updatedAt_gte: DateTime
693 | }
694 |
695 | enum UserOrderBy {
696 | createdAt_ASC
697 | createdAt_DESC
698 | github_ASC
699 | github_DESC
700 | id_ASC
701 | id_DESC
702 | name_ASC
703 | name_DESC
704 | updatedAt_ASC
705 | updatedAt_DESC
706 | }
707 |
708 | # This is the famous Relay viewer object
709 | type Viewer {
710 | allFiles(filter: FileFilter, orderBy: FileOrderBy, skip: Int, after: String, before: String, first: Int, last: Int): FileConnection!
711 | allUsers(filter: UserFilter, orderBy: UserOrderBy, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection!
712 | user: User
713 | File(id: ID, secret: String, url: String): File
714 | User(id: ID): User
715 | id: ID!
716 | }
717 |
--------------------------------------------------------------------------------
/setup.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | // by nic - 2017 –– 10 locs pra você não precisar dar eject
3 |
4 | const fs = require('fs'),
5 | file = require('path').resolve('./node_modules/babel-preset-react-app/index.js'),
6 | texts = fs.readFileSync(file, 'utf8'),
7 | plugin = 'babel-plugin-relay',
8 | pattern = 'const plugins = [';
9 |
10 | if (!texts.includes(pattern)) throw new Error(`Failed to inject babel-plugin-relay.`);
11 |
12 | if (!texts.includes(plugin))
13 | fs.writeFileSync(file, texts.replace(pattern, `${pattern}\n require.resolve('${plugin}'),`), 'utf8');
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Header from './components/Header'
3 | import MainRelay from './MainRelay'
4 |
5 | const App = () =>
6 |