Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
delete ctx.nodeMap.Query;
includeQuery = false;
}
if (!subscriptionNode || subscriptionNode.fields.length === 0) {
delete ctx.nodeMap.Subscription;
includeSubscription = false;
}
const ops = [];
if (includeQuery) {
ops.push(makeOperationType('query', queryNode.name.value));
}
if (includeMutation) {
ops.push(makeOperationType('mutation', mutationNode.name.value));
}
if (includeSubscription) {
ops.push(makeOperationType('subscription', subscriptionNode.name.value));
}
const schema = makeSchema(ops);
ctx.putSchema(schema);
const astSansDirectives = stripDirectives(
{
kind: 'Document',
definitions: Object.keys(ctx.nodeMap).map((k: string) => ctx.getType(k)),
},
['aws_subscribe', 'aws_auth', 'aws_api_key', 'aws_iam', 'aws_oidc', 'aws_cognito_user_pools', 'deprecated']
);
const SDL = print(astSansDirectives);
return SDL;
}
includeMutation = false;
}
if (!queryNode || queryNode.fields.length === 0) {
delete ctx.nodeMap.Query;
includeQuery = false;
}
if (!subscriptionNode || subscriptionNode.fields.length === 0) {
delete ctx.nodeMap.Subscription;
includeSubscription = false;
}
const ops = [];
if (includeQuery) {
ops.push(makeOperationType('query', queryNode.name.value));
}
if (includeMutation) {
ops.push(makeOperationType('mutation', mutationNode.name.value));
}
if (includeSubscription) {
ops.push(makeOperationType('subscription', subscriptionNode.name.value));
}
const schema = makeSchema(ops);
ctx.putSchema(schema);
const astSansDirectives = stripDirectives(
{
kind: 'Document',
definitions: Object.keys(ctx.nodeMap).map((k: string) => ctx.getType(k)),
},
['aws_subscribe', 'aws_auth', 'aws_api_key', 'aws_iam', 'aws_oidc', 'aws_cognito_user_pools', 'deprecated']
);
const SDL = print(astSansDirectives);
return SDL;
}
includeMutation = false
}
if (!queryNode || queryNode.fields.length === 0) {
delete ctx.nodeMap.Query
includeQuery = false
}
if (!subscriptionNode || subscriptionNode.fields.length === 0) {
delete ctx.nodeMap.Subscription
includeSubscription = false
}
const ops = []
if (includeQuery) {
ops.push(makeOperationType('query', queryNode.name.value))
}
if (includeMutation) {
ops.push(makeOperationType('mutation', mutationNode.name.value))
}
if (includeSubscription) {
ops.push(makeOperationType('subscription', subscriptionNode.name.value))
}
const schema = makeSchema(ops)
ctx.putSchema(schema)
const astSansDirectives = stripDirectives({
kind: 'Document',
definitions: Object.keys(ctx.nodeMap).map((k: string) => ctx.getType(k))
}, ['aws_subscribe', 'aws_auth'])
const SDL = print(astSansDirectives)
return SDL;
}
let includeSubscription = true
if (!mutationNode || mutationNode.fields.length === 0) {
delete ctx.nodeMap.Mutation
includeMutation = false
}
if (!queryNode || queryNode.fields.length === 0) {
delete ctx.nodeMap.Query
includeQuery = false
}
if (!subscriptionNode || subscriptionNode.fields.length === 0) {
delete ctx.nodeMap.Subscription
includeSubscription = false
}
const ops = []
if (includeQuery) {
ops.push(makeOperationType('query', queryNode.name.value))
}
if (includeMutation) {
ops.push(makeOperationType('mutation', mutationNode.name.value))
}
if (includeSubscription) {
ops.push(makeOperationType('subscription', subscriptionNode.name.value))
}
const schema = makeSchema(ops)
ctx.putSchema(schema)
const astSansDirectives = stripDirectives({
kind: 'Document',
definitions: Object.keys(ctx.nodeMap).map((k: string) => ctx.getType(k))
}, ['aws_subscribe', 'aws_auth'])
const SDL = print(astSansDirectives)
return SDL;
}
let includeSubscription = true;
if (!mutationNode || mutationNode.fields.length === 0) {
delete ctx.nodeMap.Mutation;
includeMutation = false;
}
if (!queryNode || queryNode.fields.length === 0) {
delete ctx.nodeMap.Query;
includeQuery = false;
}
if (!subscriptionNode || subscriptionNode.fields.length === 0) {
delete ctx.nodeMap.Subscription;
includeSubscription = false;
}
const ops = [];
if (includeQuery) {
ops.push(makeOperationType('query', queryNode.name.value));
}
if (includeMutation) {
ops.push(makeOperationType('mutation', mutationNode.name.value));
}
if (includeSubscription) {
ops.push(makeOperationType('subscription', subscriptionNode.name.value));
}
const schema = makeSchema(ops);
ctx.putSchema(schema);
const astSansDirectives = stripDirectives(
{
kind: 'Document',
definitions: Object.keys(ctx.nodeMap).map((k: string) => ctx.getType(k)),
},
['aws_subscribe', 'aws_auth', 'aws_api_key', 'aws_iam', 'aws_oidc', 'aws_cognito_user_pools', 'deprecated']
);
delete ctx.nodeMap.Query
includeQuery = false
}
if (!subscriptionNode || subscriptionNode.fields.length === 0) {
delete ctx.nodeMap.Subscription
includeSubscription = false
}
const ops = []
if (includeQuery) {
ops.push(makeOperationType('query', queryNode.name.value))
}
if (includeMutation) {
ops.push(makeOperationType('mutation', mutationNode.name.value))
}
if (includeSubscription) {
ops.push(makeOperationType('subscription', subscriptionNode.name.value))
}
const schema = makeSchema(ops)
ctx.putSchema(schema)
const astSansDirectives = stripDirectives({
kind: 'Document',
definitions: Object.keys(ctx.nodeMap).map((k: string) => ctx.getType(k))
}, ['aws_subscribe', 'aws_auth'])
const SDL = print(astSansDirectives)
return SDL;
}