-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathgraphiql.react.txt
67 lines (60 loc) · 4.2 KB
/
graphiql.react.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
┏━━━━━━━━━━━━━━┓
┃ GRAPHIQL ┃
┗━━━━━━━━━━━━━━┛
VERSION ==> #0.9.3
#React component to execute client-side graphQL operation, and explore schema
<GraphiQL/> #React component to:
# - execute client-side graphQL operations (including variables) with code editor
# (using CodeMirror)
# - schema explorer (includes all introspection of __schema root types,
# including description, excluding deprecation)
#Props:
# - fetcher(BODY)->PROMISE(RESPONSE):
# - should POST graphql endpoint with Content-Type: application/json [C] and request BODY
# - schema SCHEMA (def: uses introspection query)
# - query 'QUERY': initially shown
# - defaultQuery 'QUERY': shown when query is empty
# - variables 'VARIABLES': initially shown
# - operationName 'OPNAME'
# - onEditQuery('QUERY'), onEditVariables('VARIABLES'), onEditOperationName('OPNAME'),
# onToggleDocs(BOOL): hooks
# - editorTheme STR (def: 'graphiql'): CodeMirror CSS theme
#Does:
# - syntax highlighting
# - validation and error reporing
# - autocomplete
# - auto-add possible subfields when adding parent field
# - prettify button
# - persists on localStorage (or PROPS.storage)
#Can customize further, by reimplementing render() and reusing children components
#(see online doc), e.g. changing logo, footer, layout, etc.
GRAPHIQL-APP ==> ##GraphiQL as an Electron desktop app
##Version 0.5.0
┌───────────────┐
│ WORKSPACE │
└───────────────┘
VERSION ==> ##1.0.4
##Built on top of GraphiQL:
## - adds:
## - tabs, for multiple queries
## - save queries, history
## - endpoint input field
## - custom HTTP headers
## - export|import config
## - save queries, history
## - request proxy
## - removes:
## - cannot specify GraphiQL props: storage, defaultQuery, operationName, schema, hooks,
## editorTheme
## - less options to customize logo, etc.
##Must include Bootstrap CSS, WINDOW.fetch polyfill
new AppConfig("graphiql", OPTS) ##OPTS:
## - defaultUrl STR
## - defaultQuery 'QUERY'
## - defaultVariables 'VARIABLES'
## - defaultHeaders OBJ_ARR: name STR, value STR
<GraphiQLWorkspace/> ##React component
##Props:
## - config APPCONFIG
## - proxyUrl STR
## - onToolbar('reopen|export|restore|clean', VAL): hook