@operato/app 1.19.14 → 1.19.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/app",
|
|
3
3
|
"description": "WebApplication production supporting components following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "1.19.
|
|
5
|
+
"version": "1.19.16",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -138,10 +138,7 @@
|
|
|
138
138
|
"@codemirror/state": "^6.3.3",
|
|
139
139
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
140
140
|
"@codemirror/view": "^6.22.1",
|
|
141
|
-
"@graphql-tools/
|
|
142
|
-
"@graphql-tools/load": "^7.0.0",
|
|
143
|
-
"@graphql-tools/schema": "^9.0.0",
|
|
144
|
-
"@graphql-tools/url-loader": "^7.0.0",
|
|
141
|
+
"@graphql-tools/wrap": "^9.0.0",
|
|
145
142
|
"@material/mwc-button": "^0.27.0",
|
|
146
143
|
"@material/mwc-icon": "^0.27.0",
|
|
147
144
|
"@material/mwc-icon-button": "^0.27.0",
|
|
@@ -197,5 +194,5 @@
|
|
|
197
194
|
"prettier --write"
|
|
198
195
|
]
|
|
199
196
|
},
|
|
200
|
-
"gitHead": "
|
|
197
|
+
"gitHead": "7edc0577bdaeb373ec3f54f076518047b3c4e56b"
|
|
201
198
|
}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { print } from 'graphql'
|
|
6
|
+
|
|
7
|
+
import { css, PropertyValues } from 'lit'
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
7
9
|
import { graphql } from 'cm6-graphql'
|
|
8
10
|
|
|
9
11
|
import { history, historyKeymap, indentWithTab } from '@codemirror/commands'
|
|
@@ -12,9 +14,7 @@ import { bracketMatching, syntaxHighlighting } from '@codemirror/language'
|
|
|
12
14
|
import { oneDarkHighlightStyle, oneDark } from '@codemirror/theme-one-dark'
|
|
13
15
|
import { EditorView, highlightActiveLine, keymap } from '@codemirror/view'
|
|
14
16
|
|
|
15
|
-
import {
|
|
16
|
-
import { loadSchema } from '@graphql-tools/load'
|
|
17
|
-
import { UrlLoader } from '@graphql-tools/url-loader'
|
|
17
|
+
import { introspectSchema, wrapSchema } from '@graphql-tools/wrap'
|
|
18
18
|
import { GRAPHQL_URI } from '@operato/graphql'
|
|
19
19
|
import { OxFormField } from '@operato/input'
|
|
20
20
|
import { togglefullscreen } from '@operato/utils'
|
|
@@ -66,16 +66,24 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
async getSchema() {
|
|
69
|
-
const
|
|
69
|
+
const executor = async ({ document, variables }: any) => {
|
|
70
|
+
const query = print(document)
|
|
71
|
+
const uri = this.link || GRAPHQL_URI
|
|
72
|
+
|
|
73
|
+
const fetchResult = await fetch(uri, {
|
|
74
|
+
method: 'POST',
|
|
75
|
+
headers: {
|
|
76
|
+
'Content-Type': 'application/json'
|
|
77
|
+
},
|
|
78
|
+
body: JSON.stringify({ query, variables })
|
|
79
|
+
})
|
|
80
|
+
return fetchResult.json()
|
|
81
|
+
}
|
|
70
82
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
'Content-Type': 'application/json'
|
|
75
|
-
}
|
|
83
|
+
return await wrapSchema({
|
|
84
|
+
schema: await introspectSchema(executor),
|
|
85
|
+
executor
|
|
76
86
|
})
|
|
77
|
-
|
|
78
|
-
return makeExecutableSchema({ typeDefs: schema, resolvers: {} })
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
async getEditor() {
|