How to use the buildClientSchema function from graphql
Find comprehensive JavaScript graphql.buildClientSchema code examples handpicked from public code repositorys.
62 63 64 65 66 67 68 69 70
? getSchemaIntrospection(schemaReference) : schemaReference; if (introspection.__schema) { return buildClientSchema((introspection: any)); } else if (introspection.data && introspection.data.__schema) { return buildClientSchema((introspection.data: any)); } else if (introspection.kind && introspection.kind === 'Document') { return buildASTSchema(introspection); }
0
24
9
+ 3 other calls in file
GitHub: celestiaorg/celbot
0 1 2 3 4 5 6 7 8 9 10 11 12
// REF: https://docs.github.com/en/graphql/overview/explorer const { parse, validate, buildClientSchema } = require("graphql"); const introspectionResult = require("./introspection-result.json"); const schema = buildClientSchema(introspectionResult); exports.isValid = async function (query) { let valid = true; // Parse the query
0
3
0
38 39 40 41 42 43 44 45 46
const { data } = await response.json(); // Generate fallback schema file await fs.promises.writeFile('./src/graphql/schema/schema.json', JSON.stringify(data, null, 2)); return buildClientSchema(data); };
0
3
0
24 25 26 27 28 29 30 31 32 33
console.log(`[SUCCESS] Fetch introspection query from ${API_URL}`); const data = await response.json(); return buildClientSchema(data.data); } catch (error) { console.log(`[FAILED] Fetch introspection query from ${API_URL}`); console.error('[FAILED]', error.stack.replaceAll('\n', '\n[FAILED]')); }
0
1
0
496 497 498 499 500 501 502 503 504 505
this.setState({ schema: graphql_1.buildSchema(this.props.schema) }); // if it's an object, it must be an introspection query } else { this.setState({ schema: graphql_1.buildClientSchema(this.props.schema) }); } } };
0
0
2
+ 4 other calls in file
297 298 299 300 301 302 303 304 305 306
if (typeof this.props.schema === 'string') { this.setState({ schema: graphql_1.buildSchema(this.props.schema) }); // if it's an object, it must be an introspection query } else { this.setState({ schema: graphql_1.buildClientSchema(this.props.schema) }); } } }; PlaygroundWrapper.prototype.setInitialWorkspace = function (props) {
0
0
2
+ 4 other calls in file
38 39 40 41 42 43 44 45 46 47
.post(process.env.VUE_APP_GRAPHQL_ENDPOINT_SCHEMA) .send(body) .set('Content-Type', 'application/json') .set('Authorization', `Bearer ${token.access_token}`); if (!response.body.data) return new Error('Не удалось скачать схему!'); const clientSchema = buildClientSchema(response.body.data); const sdl = printSchema(clientSchema); fs.writeFileSync(process.env.GRAPHQL_SCHEMA_PATH, sdl); console.info('Схема обновилась!'); console.info('_____________________________________________________');
0
0
0
+ 2 other calls in file
-1
fs.writeFileSync('schema-'+Date.now()+'.graphql',schemaString);
0
0
0
41 42 43 44 45 46 47 48 49 50 51 52
AWSDateTime: "string", AWSJSON: "string", AWSURL: "string", }; const schema = buildClientSchema(introspecSchema.data); const queryType = schema.getType("Query"); const mutationType = schema.getType("Mutation"); if (!queryType) throw new Error("Query type not found");
0
0
0
88 89 90 91 92 93 94 95 96 97
} if (isSchemaText(fileExport)) { return graphql.parse(fileExport); } if (isWrappedSchemaJson(fileExport)) { return graphql.buildClientSchema(fileExport.data); } if (isSchemaJson(fileExport)) { return graphql.buildClientSchema(fileExport); }
0
0
1
+ 3 other calls in file
42 43 44 45 46 47 48 49 50 51
default: return 'sample value' } }; const refMutationName = derive.mutation.name; const hasuraSchema = buildClientSchema(derive.introspection_schema); const mutationType = hasuraSchema._mutationType; const allMutations = mutationType._fields; const refMutation = allMutations[refMutationName]; const nonNullableArguments = {};
0
0
0
21 22 23 24 25 26 27 28 29
var invariant = require('./invariant'); var util = require('./util'); var _require = require('graphql'), buildASTSchema = _require.buildASTSchema, buildClientSchema = _require.buildClientSchema; var PROVIDES_MODULE = 'providesModule'; var RELAY_QL_GENERATED = 'RelayQL_GENERATED';
0
0
2
graphql.GraphQLNonNull is the most popular function in graphql (4226 examples)