How to use the GraphQLSchema function from graphql
Find comprehensive JavaScript graphql.GraphQLSchema code examples handpicked from public code repositorys.
126 127 128 129 130 131 132 133 134 135
type: graphql.GraphQLString } } }) var schema = new graphql.GraphQLSchema({ query: new graphql.GraphQLObjectType({ name: 'Query' fields: { film: {
34
639
14
+ 3 other calls in file
175 176 177 178 179 180 181 182 183 184
} }; } }); const Schema = new GraphQLSchema({ query: Query }); module.exports = Schema;
54
304
13
+ 3 other calls in file
183 184 185 186 187 188 189 190 191 192
使用指定的 query 及 mutation(可选)的根类型来创建 Schema。生成的 Schema 可用于之后的验证器和执行器。 #### 示例 ```js var MyAppSchema = new GraphQLSchema({ query: MyAppQueryRootType mutation: MyAppMutationRootType }); ```
0
188
18
+ 3 other calls in file
43 44 45 46 47 48 49 50 51 52
type: graphql.GraphQLString } }) }); const apiSchema = new graphql.GraphQLSchema({ query: queryType }); exports.getQuery = function (req, res, next) {
43
139
16
103 104 105 106 107 108 109 110 111
} } } }); module.exports = new GraphQLSchema({ query: RootQuery }); ```
9
18
2
91 92 93 94 95 96 97 98 99
} } } }); const ChockNorrisSchema = new GraphQLSchema({ query: ChuckNorrisQueryType, mutation: ChuckNorrisMutationType });
1
5
2
GitHub: skitsanos/foxx-builder
47 48 49 50 51 52 53 54 55 56 57
return result.next(); } }); module.exports = { schema: new GraphQLSchema({ query: new GraphQLObjectType({ name: 'RootQueryType', fields: { hello: {
2
26
0
24 25 26 27 28 29 30 31 32 33
assertCompositeType = _require2.assertCompositeType, isInterfaceType = _require2.isInterfaceType, getNullableType = _require2.getNullableType, GraphQLInterfaceType = _require2.GraphQLInterfaceType, GraphQLObjectType = _require2.GraphQLObjectType, GraphQLSchema = _require2.GraphQLSchema; var _require3 = require('./GraphQLCompilerPublic'), CompilerContext = _require3.CompilerContext, SchemaUtils = _require3.SchemaUtils,
0
1
2
12 13 14 15 16 17 18 19 20 21
}); // const mutation = new GraphQLObjectType({ // name: 'Mutation', // fields: {}, // }); exports.schema = new graphql_1.GraphQLSchema({ query, // mutation, }); exports.permissions = (0, graphql_shield_1.shield)({
0
0
1
GitHub: datagov-cz/nkod-graphql
17 18 19 20 21 22 23 24 25 26 27
await initializeDatabase() startServer(app); })(); function addGraphQlApi(app) { const schema = new graphql.GraphQLSchema({ "query": schemaDefinition }); app.use("/graphql", graphqlHTTP({ "schema": schema,
0
0
4
+ 46 other calls in file
125 126 127 128 129 130
return (0, recipe_1.likeRecipe)(id, args.recipeId); }, }, }, }); exports.default = new graphql_1.GraphQLSchema({ query: RecipeRootQuery, mutation });
0
0
0
GitHub: Noly-17/graphql-todo
72 73 74 75 76 77 78 79 80 81
return todos_json_1.default[index]; }, }, }), }); const root = new graphql_1.GraphQLSchema({ query: RootQuery, mutation, }); exports.default = root;
0
0
0
+ 3 other calls in file
1404 1405 1406 1407 1408 1409 1410 1411 1412 1413
} = getMutationsForList(list); updateManyByList[list.listKey] = updateManyInput; return mutations; }), extraFields.mutation) }); const graphQLSchema = new graphql$1.GraphQLSchema({ query: query.graphQLType, mutation: mutation.graphQLType, // not about behaviour, only ordering types: [...collectTypes(lists, updateManyByList), mutation.graphQLType]
0
0
0
76 77 78 79 80 81 82 83
} } }) module.exports = new GraphQLSchema({ query: RootQuery, mutation: Mutation })
0
0
0
240 241 242 243 244 245 246 247 248 249
return user_js_1.userCollection.findById(args.id); }, }, }, }); const userSchema = new graphql_1.GraphQLSchema({ mutation: userMutation, }); console.log(cartType); exports.default = userSchema;
0
0
0
+ 3 other calls in file
38 39 40 41 42 43 44 45 46
return product_js_1.default.find({}); }, }, }, }); const graphQlSchema = new graphql_1.GraphQLSchema({ query, }); exports.default = graphQlSchema;
0
0
0
graphql.GraphQLNonNull is the most popular function in graphql (4226 examples)