How to use the extendSchema function from graphql
Find comprehensive JavaScript graphql.extendSchema code examples handpicked from public code repositorys.
7 8 9 10 11 12 13 14 15 16
let astDocument = parse(typeDefs); let schema = buildASTSchema(astDocument); let extensionsAst = extractExtensionDefinitions(astDocument); if (extensionsAst.definitions.length > 0) { schema = extendSchema(schema, extensionsAst); } return schema; };
0
29
2
GitHub: artsy/relay
193 194 195 196 197 198 199 200 201 202
if (schemaExtensions.length <= 0) { return baseSchema; } // TODO T24511737 figure out if this is dangerous return extendSchema( baseSchema, { kind: 'Document', definitions: schemaExtensions,
0
10
3
+ 3 other calls in file
GitHub: jmarksharkey/relay
163 164 165 166 167 168 169 170 171 172
if (schemaExtensions.length <= 0) { return baseSchema; } return extendSchema(baseSchema, { kind: 'Document', // Flow doesn't recognize that TypeSystemDefinitionNode is a subset of DefinitionNode definitions: (schemaExtensions: Array<$FlowFixMe>), });
0
0
2
GitHub: bbenoist/relay
156 157 158 159 160 161 162 163 164
if (schemaExtensions.length === 0) { return schema; } const extension = schemaExtensions.join('\n'); return cachedExtend(schema, extension, () => extendSchema(schema, parse(extension)), ); }); }
0
0
1
+ 3 other calls in file
GitHub: HankMcCoy/relay
142 143 144 145 146 147 148 149 150 151
function transformASTSchema( schema: GraphQLSchema, schemaExtensions: Array<string>, ): GraphQLSchema { return GraphQL.extendSchema( schema, GraphQL.parse(schemaExtensions.join('\n')), ); }
0
0
2
graphql.GraphQLNonNull is the most popular function in graphql (4226 examples)