Initialisation
Added the packages and files for the backend server
This commit is contained in:
145
node_modules/graphql/utilities/getIntrospectionQuery.js
generated
vendored
Normal file
145
node_modules/graphql/utilities/getIntrospectionQuery.js
generated
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true,
|
||||
});
|
||||
exports.getIntrospectionQuery = getIntrospectionQuery;
|
||||
|
||||
/**
|
||||
* Produce the GraphQL query recommended for a full schema introspection.
|
||||
* Accepts optional IntrospectionOptions.
|
||||
*/
|
||||
function getIntrospectionQuery(options) {
|
||||
const optionsWithDefault = {
|
||||
descriptions: true,
|
||||
specifiedByUrl: false,
|
||||
directiveIsRepeatable: false,
|
||||
schemaDescription: false,
|
||||
inputValueDeprecation: false,
|
||||
oneOf: false,
|
||||
...options,
|
||||
};
|
||||
const descriptions = optionsWithDefault.descriptions ? 'description' : '';
|
||||
const specifiedByUrl = optionsWithDefault.specifiedByUrl
|
||||
? 'specifiedByURL'
|
||||
: '';
|
||||
const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable
|
||||
? 'isRepeatable'
|
||||
: '';
|
||||
const schemaDescription = optionsWithDefault.schemaDescription
|
||||
? descriptions
|
||||
: '';
|
||||
|
||||
function inputDeprecation(str) {
|
||||
return optionsWithDefault.inputValueDeprecation ? str : '';
|
||||
}
|
||||
|
||||
const oneOf = optionsWithDefault.oneOf ? 'isOneOf' : '';
|
||||
return `
|
||||
query IntrospectionQuery {
|
||||
__schema {
|
||||
${schemaDescription}
|
||||
queryType { name }
|
||||
mutationType { name }
|
||||
subscriptionType { name }
|
||||
types {
|
||||
...FullType
|
||||
}
|
||||
directives {
|
||||
name
|
||||
${descriptions}
|
||||
${directiveIsRepeatable}
|
||||
locations
|
||||
args${inputDeprecation('(includeDeprecated: true)')} {
|
||||
...InputValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fragment FullType on __Type {
|
||||
kind
|
||||
name
|
||||
${descriptions}
|
||||
${specifiedByUrl}
|
||||
${oneOf}
|
||||
fields(includeDeprecated: true) {
|
||||
name
|
||||
${descriptions}
|
||||
args${inputDeprecation('(includeDeprecated: true)')} {
|
||||
...InputValue
|
||||
}
|
||||
type {
|
||||
...TypeRef
|
||||
}
|
||||
isDeprecated
|
||||
deprecationReason
|
||||
}
|
||||
inputFields${inputDeprecation('(includeDeprecated: true)')} {
|
||||
...InputValue
|
||||
}
|
||||
interfaces {
|
||||
...TypeRef
|
||||
}
|
||||
enumValues(includeDeprecated: true) {
|
||||
name
|
||||
${descriptions}
|
||||
isDeprecated
|
||||
deprecationReason
|
||||
}
|
||||
possibleTypes {
|
||||
...TypeRef
|
||||
}
|
||||
}
|
||||
|
||||
fragment InputValue on __InputValue {
|
||||
name
|
||||
${descriptions}
|
||||
type { ...TypeRef }
|
||||
defaultValue
|
||||
${inputDeprecation('isDeprecated')}
|
||||
${inputDeprecation('deprecationReason')}
|
||||
}
|
||||
|
||||
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
|
||||
ofType {
|
||||
kind
|
||||
name
|
||||
ofType {
|
||||
kind
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
Reference in New Issue
Block a user