swc/bundler/tests/.cache/deno/23f4b2f19f08795e4cc4cbeda7d20befdc86cde0.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

109 lines
2.2 KiB
TypeScript

// Loaded from https://deno.land/x/graphql_deno@v15.0.0/lib/utilities/getIntrospectionQuery.js
export function getIntrospectionQuery(options) {
const optionsWithDefault = {
descriptions: true,
directiveIsRepeatable: false,
schemaDescription: false,
...options
};
const descriptions = optionsWithDefault.descriptions ? 'description' : '';
const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable ? 'isRepeatable' : '';
const schemaDescription = optionsWithDefault.schemaDescription ? descriptions : '';
return `
query IntrospectionQuery {
__schema {
${schemaDescription}
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
${descriptions}
${directiveIsRepeatable}
locations
args {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
${descriptions}
fields(includeDeprecated: true) {
name
${descriptions}
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
${descriptions}
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
${descriptions}
type { ...TypeRef }
defaultValue
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}
`;
}