Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseGraphQLText(
schema: GraphQLSchema,
text: string,
): {
definitions: $ReadOnlyArray,
schema: ?GraphQLSchema,
} {
const ast = parse(text);
// TODO T24511737 figure out if this is dangerous
const extendedSchema = extendSchema(schema, ast, {assumeValid: true});
const definitions = convertASTDocuments(
extendedSchema,
[ast],
[],
Parser.transform.bind(Parser),
);
return {
definitions,
schema: extendedSchema !== schema ? extendedSchema : null,
};
}
function parseGraphQLText(
schema: GraphQLSchema,
text: string,
): {
definitions: Array,
schema: ?GraphQLSchema,
} {
const ast = parse(text);
const extendedSchema = extendSchema(schema, ast);
const definitions = convertASTDocuments(
extendedSchema,
[ast],
[],
Parser.transform.bind(Parser),
);
return {
definitions,
schema: extendedSchema !== schema ? extendedSchema : null,
};
}
function parseGraphQLText(
schema: GraphQLSchema,
text: string,
): {
definitions: $ReadOnlyArray,
schema: GraphQLSchema,
} {
const ast = parse(text);
const extendedSchema = extendSchema(schema, ast, {assumeValid: true});
const definitions = convertASTDocuments(
Schema.DEPRECATED__create(schema, extendedSchema),
[ast],
Parser.transform.bind(Parser),
);
return {
definitions,
schema: extendedSchema,
};
}