mirror of
https://github.com/swc-project/swc.git
synced 2024-12-30 17:15:11 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
109 lines
2.2 KiB
TypeScript
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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
} |