@graphql-tools/utils 8.2.1 → 8.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/comments.d.ts +3 -1
- package/implementsAbstractType.d.ts +1 -1
- package/index.js +29 -22
- package/index.mjs +29 -23
- package/package.json +1 -1
- package/es5/AggregateError.d.ts +0 -10
- package/es5/Interfaces.d.ts +0 -242
- package/es5/addTypes.d.ts +0 -2
- package/es5/astFromType.d.ts +0 -2
- package/es5/astFromValueUntyped.d.ts +0 -17
- package/es5/build-operation-for-field.d.ts +0 -18
- package/es5/collectFields.d.ts +0 -5
- package/es5/comments.d.ts +0 -28
- package/es5/errors.d.ts +0 -2
- package/es5/executor.d.ts +0 -7
- package/es5/fields.d.ts +0 -5
- package/es5/filterSchema.d.ts +0 -12
- package/es5/fixSchemaAst.d.ts +0 -3
- package/es5/forEachDefaultValue.d.ts +0 -3
- package/es5/forEachField.d.ts +0 -3
- package/es5/get-directives.d.ts +0 -11
- package/es5/get-fields-with-directives.d.ts +0 -16
- package/es5/get-implementing-types.d.ts +0 -2
- package/es5/getArgumentValues.d.ts +0 -10
- package/es5/getObjectTypeFromTypeMap.d.ts +0 -3
- package/es5/getResolversFromSchema.d.ts +0 -3
- package/es5/getResponseKeyFromInfo.d.ts +0 -7
- package/es5/heal.d.ts +0 -3
- package/es5/helpers.d.ts +0 -9
- package/es5/implementsAbstractType.d.ts +0 -3
- package/es5/index.d.ts +0 -49
- package/es5/index.js +0 -4839
- package/es5/index.mjs +0 -4732
- package/es5/inspect.d.ts +0 -4
- package/es5/isAsyncIterable.d.ts +0 -1
- package/es5/isDocumentNode.d.ts +0 -2
- package/es5/loaders.d.ts +0 -18
- package/es5/mapAsyncIterator.d.ts +0 -5
- package/es5/mapSchema.d.ts +0 -7
- package/es5/memoize.d.ts +0 -6
- package/es5/mergeDeep.d.ts +0 -9
- package/es5/observableToAsyncIterable.d.ts +0 -12
- package/es5/package.json +0 -35
- package/es5/parse-graphql-json.d.ts +0 -4
- package/es5/parse-graphql-sdl.d.ts +0 -13
- package/es5/print-schema-with-directives.d.ts +0 -21
- package/es5/prune.d.ts +0 -8
- package/es5/renameType.d.ts +0 -8
- package/es5/rewire.d.ts +0 -5
- package/es5/rootTypes.d.ts +0 -5
- package/es5/selectionSets.d.ts +0 -3
- package/es5/stub.d.ts +0 -9
- package/es5/transformInputValue.d.ts +0 -6
- package/es5/types.d.ts +0 -49
- package/es5/updateArgument.d.ts +0 -3
- package/es5/validate-documents.d.ts +0 -9
- package/es5/valueMatchesCriteria.d.ts +0 -1
- package/es5/visitResult.d.ts +0 -15
- package/es5/withCancel.d.ts +0 -3
package/comments.d.ts
CHANGED
|
@@ -17,8 +17,10 @@ export declare function getDescription(node: {
|
|
|
17
17
|
}, options?: {
|
|
18
18
|
commentDescriptions?: boolean;
|
|
19
19
|
}): string | undefined;
|
|
20
|
+
export declare function getComment(node: {
|
|
21
|
+
loc?: Location;
|
|
22
|
+
}): undefined | string;
|
|
20
23
|
export declare function getLeadingCommentBlock(node: {
|
|
21
|
-
description?: StringValueNode;
|
|
22
24
|
loc?: Location;
|
|
23
25
|
}): void | string;
|
|
24
26
|
export declare function dedentBlockStringValue(rawString: string): string;
|
package/index.js
CHANGED
|
@@ -1324,7 +1324,7 @@ function collectComment(node) {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
}
|
|
1326
1326
|
function pushComment(node, entity, field, argument) {
|
|
1327
|
-
const comment =
|
|
1327
|
+
const comment = getComment(node);
|
|
1328
1328
|
if (typeof comment !== 'string' || comment.length === 0) {
|
|
1329
1329
|
return;
|
|
1330
1330
|
}
|
|
@@ -1460,7 +1460,12 @@ const printDocASTReducer = {
|
|
|
1460
1460
|
IntValue: { leave: ({ value }) => value },
|
|
1461
1461
|
FloatValue: { leave: ({ value }) => value },
|
|
1462
1462
|
StringValue: {
|
|
1463
|
-
leave: ({ value, block: isBlockString }) =>
|
|
1463
|
+
leave: ({ value, block: isBlockString }) => {
|
|
1464
|
+
if (isBlockString) {
|
|
1465
|
+
return printBlockString(value);
|
|
1466
|
+
}
|
|
1467
|
+
return JSON.stringify(value);
|
|
1468
|
+
},
|
|
1464
1469
|
},
|
|
1465
1470
|
BooleanValue: { leave: ({ value }) => (value ? 'true' : 'false') },
|
|
1466
1471
|
NullValue: { leave: () => 'null' },
|
|
@@ -1478,21 +1483,19 @@ const printDocASTReducer = {
|
|
|
1478
1483
|
NonNullType: { leave: ({ type }) => type + '!' },
|
|
1479
1484
|
// Type System Definitions
|
|
1480
1485
|
SchemaDefinition: {
|
|
1481
|
-
leave: ({
|
|
1486
|
+
leave: ({ directives, operationTypes }) => join(['schema', join(directives, ' '), block(operationTypes)], ' '),
|
|
1482
1487
|
},
|
|
1483
1488
|
OperationTypeDefinition: {
|
|
1484
1489
|
leave: ({ operation, type }) => operation + ': ' + type,
|
|
1485
1490
|
},
|
|
1486
1491
|
ScalarTypeDefinition: {
|
|
1487
|
-
leave: ({
|
|
1492
|
+
leave: ({ name, directives }) => join(['scalar', name, join(directives, ' ')], ' '),
|
|
1488
1493
|
},
|
|
1489
1494
|
ObjectTypeDefinition: {
|
|
1490
|
-
leave: ({
|
|
1491
|
-
join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '),
|
|
1495
|
+
leave: ({ name, interfaces, directives, fields }) => join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '),
|
|
1492
1496
|
},
|
|
1493
1497
|
FieldDefinition: {
|
|
1494
|
-
leave: ({
|
|
1495
|
-
name +
|
|
1498
|
+
leave: ({ name, arguments: args, type, directives }) => name +
|
|
1496
1499
|
(hasMultilineItems(args)
|
|
1497
1500
|
? wrap('(\n', indent(join(args, '\n')), '\n)')
|
|
1498
1501
|
: wrap('(', join(args, ', '), ')')) +
|
|
@@ -1501,27 +1504,25 @@ const printDocASTReducer = {
|
|
|
1501
1504
|
wrap(' ', join(directives, ' ')),
|
|
1502
1505
|
},
|
|
1503
1506
|
InputValueDefinition: {
|
|
1504
|
-
leave: ({
|
|
1507
|
+
leave: ({ name, type, defaultValue, directives }) => join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '),
|
|
1505
1508
|
},
|
|
1506
1509
|
InterfaceTypeDefinition: {
|
|
1507
|
-
leave: ({
|
|
1508
|
-
join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '),
|
|
1510
|
+
leave: ({ name, interfaces, directives, fields }) => join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '),
|
|
1509
1511
|
},
|
|
1510
1512
|
UnionTypeDefinition: {
|
|
1511
|
-
leave: ({
|
|
1513
|
+
leave: ({ name, directives, types }) => join(['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' '),
|
|
1512
1514
|
},
|
|
1513
1515
|
EnumTypeDefinition: {
|
|
1514
|
-
leave: ({
|
|
1516
|
+
leave: ({ name, directives, values }) => join(['enum', name, join(directives, ' '), block(values)], ' '),
|
|
1515
1517
|
},
|
|
1516
1518
|
EnumValueDefinition: {
|
|
1517
|
-
leave: ({
|
|
1519
|
+
leave: ({ name, directives }) => join([name, join(directives, ' ')], ' '),
|
|
1518
1520
|
},
|
|
1519
1521
|
InputObjectTypeDefinition: {
|
|
1520
|
-
leave: ({
|
|
1522
|
+
leave: ({ name, directives, fields }) => join(['input', name, join(directives, ' '), block(fields)], ' '),
|
|
1521
1523
|
},
|
|
1522
1524
|
DirectiveDefinition: {
|
|
1523
|
-
leave: ({
|
|
1524
|
-
'directive @' +
|
|
1525
|
+
leave: ({ name, arguments: args, repeatable, locations }) => 'directive @' +
|
|
1525
1526
|
name +
|
|
1526
1527
|
(hasMultilineItems(args)
|
|
1527
1528
|
? wrap('(\n', indent(join(args, '\n')), '\n)')
|
|
@@ -1574,10 +1575,13 @@ function getDescription(node, options) {
|
|
|
1574
1575
|
return node.description.value;
|
|
1575
1576
|
}
|
|
1576
1577
|
if (options === null || options === void 0 ? void 0 : options.commentDescriptions) {
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1578
|
+
return getComment(node);
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
function getComment(node) {
|
|
1582
|
+
const rawValue = getLeadingCommentBlock(node);
|
|
1583
|
+
if (rawValue !== undefined) {
|
|
1584
|
+
return dedentBlockStringValue(`\n${rawValue}`);
|
|
1581
1585
|
}
|
|
1582
1586
|
}
|
|
1583
1587
|
function getLeadingCommentBlock(node) {
|
|
@@ -3926,7 +3930,9 @@ function visitData(data, enter, leave) {
|
|
|
3926
3930
|
if (newData != null) {
|
|
3927
3931
|
for (const key in newData) {
|
|
3928
3932
|
const value = newData[key];
|
|
3929
|
-
newData
|
|
3933
|
+
Object.defineProperty(newData, key, {
|
|
3934
|
+
value: visitData(value, enter, leave),
|
|
3935
|
+
});
|
|
3930
3936
|
}
|
|
3931
3937
|
}
|
|
3932
3938
|
return leave != null ? leave(newData) : newData;
|
|
@@ -4211,6 +4217,7 @@ exports.forEachField = forEachField;
|
|
|
4211
4217
|
exports.getArgumentValues = getArgumentValues;
|
|
4212
4218
|
exports.getBlockStringIndentation = getBlockStringIndentation;
|
|
4213
4219
|
exports.getBuiltInForStub = getBuiltInForStub;
|
|
4220
|
+
exports.getComment = getComment;
|
|
4214
4221
|
exports.getDefinedRootType = getDefinedRootType;
|
|
4215
4222
|
exports.getDeprecatableDirectiveNodes = getDeprecatableDirectiveNodes;
|
|
4216
4223
|
exports.getDescription = getDescription;
|
package/index.mjs
CHANGED
|
@@ -1320,7 +1320,7 @@ function collectComment(node) {
|
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
function pushComment(node, entity, field, argument) {
|
|
1323
|
-
const comment =
|
|
1323
|
+
const comment = getComment(node);
|
|
1324
1324
|
if (typeof comment !== 'string' || comment.length === 0) {
|
|
1325
1325
|
return;
|
|
1326
1326
|
}
|
|
@@ -1456,7 +1456,12 @@ const printDocASTReducer = {
|
|
|
1456
1456
|
IntValue: { leave: ({ value }) => value },
|
|
1457
1457
|
FloatValue: { leave: ({ value }) => value },
|
|
1458
1458
|
StringValue: {
|
|
1459
|
-
leave: ({ value, block: isBlockString }) =>
|
|
1459
|
+
leave: ({ value, block: isBlockString }) => {
|
|
1460
|
+
if (isBlockString) {
|
|
1461
|
+
return printBlockString(value);
|
|
1462
|
+
}
|
|
1463
|
+
return JSON.stringify(value);
|
|
1464
|
+
},
|
|
1460
1465
|
},
|
|
1461
1466
|
BooleanValue: { leave: ({ value }) => (value ? 'true' : 'false') },
|
|
1462
1467
|
NullValue: { leave: () => 'null' },
|
|
@@ -1474,21 +1479,19 @@ const printDocASTReducer = {
|
|
|
1474
1479
|
NonNullType: { leave: ({ type }) => type + '!' },
|
|
1475
1480
|
// Type System Definitions
|
|
1476
1481
|
SchemaDefinition: {
|
|
1477
|
-
leave: ({
|
|
1482
|
+
leave: ({ directives, operationTypes }) => join(['schema', join(directives, ' '), block(operationTypes)], ' '),
|
|
1478
1483
|
},
|
|
1479
1484
|
OperationTypeDefinition: {
|
|
1480
1485
|
leave: ({ operation, type }) => operation + ': ' + type,
|
|
1481
1486
|
},
|
|
1482
1487
|
ScalarTypeDefinition: {
|
|
1483
|
-
leave: ({
|
|
1488
|
+
leave: ({ name, directives }) => join(['scalar', name, join(directives, ' ')], ' '),
|
|
1484
1489
|
},
|
|
1485
1490
|
ObjectTypeDefinition: {
|
|
1486
|
-
leave: ({
|
|
1487
|
-
join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '),
|
|
1491
|
+
leave: ({ name, interfaces, directives, fields }) => join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '),
|
|
1488
1492
|
},
|
|
1489
1493
|
FieldDefinition: {
|
|
1490
|
-
leave: ({
|
|
1491
|
-
name +
|
|
1494
|
+
leave: ({ name, arguments: args, type, directives }) => name +
|
|
1492
1495
|
(hasMultilineItems(args)
|
|
1493
1496
|
? wrap('(\n', indent(join(args, '\n')), '\n)')
|
|
1494
1497
|
: wrap('(', join(args, ', '), ')')) +
|
|
@@ -1497,27 +1500,25 @@ const printDocASTReducer = {
|
|
|
1497
1500
|
wrap(' ', join(directives, ' ')),
|
|
1498
1501
|
},
|
|
1499
1502
|
InputValueDefinition: {
|
|
1500
|
-
leave: ({
|
|
1503
|
+
leave: ({ name, type, defaultValue, directives }) => join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '),
|
|
1501
1504
|
},
|
|
1502
1505
|
InterfaceTypeDefinition: {
|
|
1503
|
-
leave: ({
|
|
1504
|
-
join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '),
|
|
1506
|
+
leave: ({ name, interfaces, directives, fields }) => join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '),
|
|
1505
1507
|
},
|
|
1506
1508
|
UnionTypeDefinition: {
|
|
1507
|
-
leave: ({
|
|
1509
|
+
leave: ({ name, directives, types }) => join(['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' '),
|
|
1508
1510
|
},
|
|
1509
1511
|
EnumTypeDefinition: {
|
|
1510
|
-
leave: ({
|
|
1512
|
+
leave: ({ name, directives, values }) => join(['enum', name, join(directives, ' '), block(values)], ' '),
|
|
1511
1513
|
},
|
|
1512
1514
|
EnumValueDefinition: {
|
|
1513
|
-
leave: ({
|
|
1515
|
+
leave: ({ name, directives }) => join([name, join(directives, ' ')], ' '),
|
|
1514
1516
|
},
|
|
1515
1517
|
InputObjectTypeDefinition: {
|
|
1516
|
-
leave: ({
|
|
1518
|
+
leave: ({ name, directives, fields }) => join(['input', name, join(directives, ' '), block(fields)], ' '),
|
|
1517
1519
|
},
|
|
1518
1520
|
DirectiveDefinition: {
|
|
1519
|
-
leave: ({
|
|
1520
|
-
'directive @' +
|
|
1521
|
+
leave: ({ name, arguments: args, repeatable, locations }) => 'directive @' +
|
|
1521
1522
|
name +
|
|
1522
1523
|
(hasMultilineItems(args)
|
|
1523
1524
|
? wrap('(\n', indent(join(args, '\n')), '\n)')
|
|
@@ -1570,10 +1571,13 @@ function getDescription(node, options) {
|
|
|
1570
1571
|
return node.description.value;
|
|
1571
1572
|
}
|
|
1572
1573
|
if (options === null || options === void 0 ? void 0 : options.commentDescriptions) {
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1574
|
+
return getComment(node);
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
function getComment(node) {
|
|
1578
|
+
const rawValue = getLeadingCommentBlock(node);
|
|
1579
|
+
if (rawValue !== undefined) {
|
|
1580
|
+
return dedentBlockStringValue(`\n${rawValue}`);
|
|
1577
1581
|
}
|
|
1578
1582
|
}
|
|
1579
1583
|
function getLeadingCommentBlock(node) {
|
|
@@ -3923,7 +3927,9 @@ function visitData(data, enter, leave) {
|
|
|
3923
3927
|
if (newData != null) {
|
|
3924
3928
|
for (const key in newData) {
|
|
3925
3929
|
const value = newData[key];
|
|
3926
|
-
newData
|
|
3930
|
+
Object.defineProperty(newData, key, {
|
|
3931
|
+
value: visitData(value, enter, leave),
|
|
3932
|
+
});
|
|
3927
3933
|
}
|
|
3928
3934
|
}
|
|
3929
3935
|
return leave != null ? leave(newData) : newData;
|
|
@@ -4172,4 +4178,4 @@ function fixSchemaAst(schema, options) {
|
|
|
4172
4178
|
return schema;
|
|
4173
4179
|
}
|
|
4174
4180
|
|
|
4175
|
-
export { AggregateErrorImpl as AggregateError, MapperKind, addTypes, appendObjectFields, asArray, assertSome, astFromArg, astFromDirective, astFromEnumType, astFromEnumValue, astFromField, astFromInputField, astFromInputObjectType, astFromInterfaceType, astFromObjectType, astFromScalarType, astFromSchema, astFromUnionType, astFromValueUntyped, buildOperationNodeForField, checkValidationErrors, collectComment, collectFields, collectSubFields, compareNodes, compareStrings, correctASTNodes, createNamedStub, createStub, createVariableNameGenerator, dedentBlockStringValue, filterSchema, fixSchemaAst, forEachDefaultValue, forEachField, getArgumentValues, getBlockStringIndentation, getBuiltInForStub, getDefinedRootType, getDeprecatableDirectiveNodes, getDescription, getDirective, getDirectiveInExtensions, getDirectiveNodes, getDirectives, getDirectivesInExtensions, getDocumentNodeFromSchema, getFieldsWithDirectives, getImplementingTypes, getLeadingCommentBlock, getResolversFromSchema, getResponseKeyFromInfo, getRootTypeMap, getRootTypeNames, getRootTypes, healSchema, healTypes, implementsAbstractType, inspect, isAsyncIterable, isDescribable, isDocumentNode, isDocumentString, isNamedStub, isSome, isValidPath, makeDeprecatedDirective, makeDirectiveNode, makeDirectiveNodes, mapAsyncIterator, mapSchema, memoize1, memoize2, memoize2of4, memoize3, memoize4, memoize5, mergeDeep, modifyObjectFields, nodeToString, observableToAsyncIterable, parseGraphQLJSON, parseGraphQLSDL, parseInputValue, parseInputValueLiteral, parseSelectionSet, printComment, printSchemaWithDirectives, printWithComments, pruneSchema, pushComment, relocatedError, removeObjectFields, renameType, resetComments, rewireTypes, selectObjectFields, serializeInputValue, transformCommentsToDescriptions, transformInputValue, updateArgument, validateGraphQlDocuments, valueMatchesCriteria, visitData, visitErrors, visitResult, withCancel };
|
|
4181
|
+
export { AggregateErrorImpl as AggregateError, MapperKind, addTypes, appendObjectFields, asArray, assertSome, astFromArg, astFromDirective, astFromEnumType, astFromEnumValue, astFromField, astFromInputField, astFromInputObjectType, astFromInterfaceType, astFromObjectType, astFromScalarType, astFromSchema, astFromUnionType, astFromValueUntyped, buildOperationNodeForField, checkValidationErrors, collectComment, collectFields, collectSubFields, compareNodes, compareStrings, correctASTNodes, createNamedStub, createStub, createVariableNameGenerator, dedentBlockStringValue, filterSchema, fixSchemaAst, forEachDefaultValue, forEachField, getArgumentValues, getBlockStringIndentation, getBuiltInForStub, getComment, getDefinedRootType, getDeprecatableDirectiveNodes, getDescription, getDirective, getDirectiveInExtensions, getDirectiveNodes, getDirectives, getDirectivesInExtensions, getDocumentNodeFromSchema, getFieldsWithDirectives, getImplementingTypes, getLeadingCommentBlock, getResolversFromSchema, getResponseKeyFromInfo, getRootTypeMap, getRootTypeNames, getRootTypes, healSchema, healTypes, implementsAbstractType, inspect, isAsyncIterable, isDescribable, isDocumentNode, isDocumentString, isNamedStub, isSome, isValidPath, makeDeprecatedDirective, makeDirectiveNode, makeDirectiveNodes, mapAsyncIterator, mapSchema, memoize1, memoize2, memoize2of4, memoize3, memoize4, memoize5, mergeDeep, modifyObjectFields, nodeToString, observableToAsyncIterable, parseGraphQLJSON, parseGraphQLSDL, parseInputValue, parseInputValueLiteral, parseSelectionSet, printComment, printSchemaWithDirectives, printWithComments, pruneSchema, pushComment, relocatedError, removeObjectFields, renameType, resetComments, rewireTypes, selectObjectFields, serializeInputValue, transformCommentsToDescriptions, transformInputValue, updateArgument, validateGraphQlDocuments, valueMatchesCriteria, visitData, visitErrors, visitResult, withCancel };
|
package/package.json
CHANGED
package/es5/AggregateError.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface AggregateError extends Error {
|
|
2
|
-
errors: any[];
|
|
3
|
-
}
|
|
4
|
-
interface AggregateErrorConstructor {
|
|
5
|
-
new (errors: Iterable<any>, message?: string): AggregateError;
|
|
6
|
-
(errors: Iterable<any>, message?: string): AggregateError;
|
|
7
|
-
readonly prototype: AggregateError;
|
|
8
|
-
}
|
|
9
|
-
declare let AggregateErrorImpl: AggregateErrorConstructor;
|
|
10
|
-
export { AggregateErrorImpl as AggregateError };
|
package/es5/Interfaces.d.ts
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { GraphQLSchema, GraphQLField, GraphQLInputType, GraphQLNamedType, GraphQLResolveInfo, GraphQLScalarType, DocumentNode, FieldNode, GraphQLEnumValue, GraphQLEnumType, GraphQLUnionType, GraphQLArgument, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLDirective, FragmentDefinitionNode, SelectionNode, ExecutionResult as GraphQLExecutionResult, GraphQLOutputType, FieldDefinitionNode, GraphQLFieldConfig, GraphQLInputFieldConfig, GraphQLArgumentConfig, GraphQLEnumValueConfig, GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLScalarLiteralParser, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, GraphQLIsTypeOfFn, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, InterfaceTypeExtensionNode, InterfaceTypeDefinitionNode, GraphQLTypeResolver, UnionTypeDefinitionNode, UnionTypeExtensionNode, InputObjectTypeExtensionNode, InputObjectTypeDefinitionNode, GraphQLType, Source, DefinitionNode, OperationTypeNode } from 'graphql';
|
|
2
|
-
export declare type ExecutionResult<TData = Record<string, any>> = GraphQLExecutionResult & {
|
|
3
|
-
data?: TData | null;
|
|
4
|
-
extensions?: Record<string, any>;
|
|
5
|
-
};
|
|
6
|
-
export interface ExecutionRequest<TArgs extends Record<string, any> = Record<string, any>, TContext = any, TRootValue = any, TExtensions = Record<string, any>> {
|
|
7
|
-
document: DocumentNode;
|
|
8
|
-
operationType: OperationTypeNode;
|
|
9
|
-
variables?: TArgs;
|
|
10
|
-
operationName?: string;
|
|
11
|
-
extensions?: TExtensions;
|
|
12
|
-
rootValue?: TRootValue;
|
|
13
|
-
context?: TContext;
|
|
14
|
-
info?: GraphQLResolveInfo;
|
|
15
|
-
}
|
|
16
|
-
export interface GraphQLParseOptions {
|
|
17
|
-
noLocation?: boolean;
|
|
18
|
-
allowLegacySDLEmptyFields?: boolean;
|
|
19
|
-
allowLegacySDLImplementsInterfaces?: boolean;
|
|
20
|
-
experimentalFragmentVariables?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Set to `true` in order to convert all GraphQL comments (marked with # sign) to descriptions (""")
|
|
23
|
-
* GraphQL has built-in support for transforming descriptions to comments (with `print`), but not while
|
|
24
|
-
* parsing. Turning the flag on will support the other way as well (`parse`)
|
|
25
|
-
*/
|
|
26
|
-
commentDescriptions?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export declare type ValidatorBehavior = 'error' | 'warn' | 'ignore';
|
|
29
|
-
/**
|
|
30
|
-
* Options for validating resolvers
|
|
31
|
-
*/
|
|
32
|
-
export interface IResolverValidationOptions {
|
|
33
|
-
/**
|
|
34
|
-
* Enable to require a resolver to be defined for any field that has
|
|
35
|
-
* arguments. Defaults to `ignore`.
|
|
36
|
-
*/
|
|
37
|
-
requireResolversForArgs?: ValidatorBehavior;
|
|
38
|
-
/**
|
|
39
|
-
* Enable to require a resolver to be defined for any field which has
|
|
40
|
-
* a return type that isn't a scalar. Defaults to `ignore`.
|
|
41
|
-
*/
|
|
42
|
-
requireResolversForNonScalar?: ValidatorBehavior;
|
|
43
|
-
/**
|
|
44
|
-
* Enable to require a resolver for be defined for all fields defined
|
|
45
|
-
* in the schema. Defaults to `ignore`.
|
|
46
|
-
*/
|
|
47
|
-
requireResolversForAllFields?: ValidatorBehavior;
|
|
48
|
-
/**
|
|
49
|
-
* Enable to require a `resolveType()` for Interface and Union types.
|
|
50
|
-
* Defaults to `ignore`.
|
|
51
|
-
*/
|
|
52
|
-
requireResolversForResolveType?: ValidatorBehavior;
|
|
53
|
-
/**
|
|
54
|
-
* Enable to require all defined resolvers to match fields that
|
|
55
|
-
* actually exist in the schema. Defaults to `error` to catch common errors.
|
|
56
|
-
*/
|
|
57
|
-
requireResolversToMatchSchema?: ValidatorBehavior;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Configuration object for adding resolvers to a schema
|
|
61
|
-
*/
|
|
62
|
-
export interface IAddResolversToSchemaOptions {
|
|
63
|
-
/**
|
|
64
|
-
* The schema to which to add resolvers
|
|
65
|
-
*/
|
|
66
|
-
schema: GraphQLSchema;
|
|
67
|
-
/**
|
|
68
|
-
* Object describing the field resolvers to add to the provided schema
|
|
69
|
-
*/
|
|
70
|
-
resolvers: IResolvers;
|
|
71
|
-
/**
|
|
72
|
-
* Override the default field resolver provided by `graphql-js`
|
|
73
|
-
*/
|
|
74
|
-
defaultFieldResolver?: IFieldResolver<any, any>;
|
|
75
|
-
/**
|
|
76
|
-
* Additional options for validating the provided resolvers
|
|
77
|
-
*/
|
|
78
|
-
resolverValidationOptions?: IResolverValidationOptions;
|
|
79
|
-
/**
|
|
80
|
-
* GraphQL object types that implement interfaces will inherit any missing
|
|
81
|
-
* resolvers from their interface types defined in the `resolvers` object
|
|
82
|
-
*/
|
|
83
|
-
inheritResolversFromInterfaces?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Set to `true` to modify the existing schema instead of creating a new one
|
|
86
|
-
*/
|
|
87
|
-
updateResolversInPlace?: boolean;
|
|
88
|
-
}
|
|
89
|
-
export declare type IScalarTypeResolver = GraphQLScalarType & {
|
|
90
|
-
__name?: string;
|
|
91
|
-
__description?: string;
|
|
92
|
-
__serialize?: GraphQLScalarSerializer<any>;
|
|
93
|
-
__parseValue?: GraphQLScalarValueParser<any>;
|
|
94
|
-
__parseLiteral?: GraphQLScalarLiteralParser<any>;
|
|
95
|
-
__extensions?: Record<string, any>;
|
|
96
|
-
__astNode?: ScalarTypeDefinitionNode;
|
|
97
|
-
__extensionASTNodes?: Array<ScalarTypeExtensionNode>;
|
|
98
|
-
};
|
|
99
|
-
export declare type IEnumTypeResolver = Record<string, any> & {
|
|
100
|
-
__name?: string;
|
|
101
|
-
__description?: string;
|
|
102
|
-
__extensions?: Record<string, any>;
|
|
103
|
-
__astNode?: EnumTypeDefinitionNode;
|
|
104
|
-
__extensionASTNodes?: Array<EnumTypeExtensionNode>;
|
|
105
|
-
};
|
|
106
|
-
export interface IFieldResolverOptions<TSource = any, TContext = any, TArgs = any> {
|
|
107
|
-
name?: string;
|
|
108
|
-
description?: string;
|
|
109
|
-
type?: GraphQLOutputType;
|
|
110
|
-
args?: Array<GraphQLArgument>;
|
|
111
|
-
resolve?: IFieldResolver<TSource, TContext, TArgs>;
|
|
112
|
-
subscribe?: IFieldResolver<TSource, TContext, TArgs>;
|
|
113
|
-
isDeprecated?: boolean;
|
|
114
|
-
deprecationReason?: string;
|
|
115
|
-
extensions?: Record<string, any>;
|
|
116
|
-
astNode?: FieldDefinitionNode;
|
|
117
|
-
}
|
|
118
|
-
export declare type FieldNodeMapper = (fieldNode: FieldNode, fragments: Record<string, FragmentDefinitionNode>, transformationContext: Record<string, any>) => SelectionNode | Array<SelectionNode>;
|
|
119
|
-
export declare type FieldNodeMappers = Record<string, Record<string, FieldNodeMapper>>;
|
|
120
|
-
export declare type InputFieldFilter = (typeName?: string, fieldName?: string, inputFieldConfig?: GraphQLInputFieldConfig) => boolean;
|
|
121
|
-
export declare type FieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig) => boolean;
|
|
122
|
-
export declare type ObjectFieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean;
|
|
123
|
-
export declare type RootFieldFilter = (operation: 'Query' | 'Mutation' | 'Subscription', rootFieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean;
|
|
124
|
-
export declare type TypeFilter = (typeName: string, type: GraphQLType) => boolean;
|
|
125
|
-
export declare type ArgumentFilter = (typeName?: string, fieldName?: string, argName?: string, argConfig?: GraphQLArgumentConfig) => boolean;
|
|
126
|
-
export declare type RenameTypesOptions = {
|
|
127
|
-
renameBuiltins: boolean;
|
|
128
|
-
renameScalars: boolean;
|
|
129
|
-
};
|
|
130
|
-
export declare type IFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn;
|
|
131
|
-
export declare type TypeSource = string | Source | DocumentNode | GraphQLSchema | DefinitionNode | Array<TypeSource> | (() => TypeSource);
|
|
132
|
-
export declare type IObjectTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
|
133
|
-
[key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
|
|
134
|
-
} & {
|
|
135
|
-
__name?: string;
|
|
136
|
-
__description?: string;
|
|
137
|
-
__isTypeOf?: GraphQLIsTypeOfFn<TSource, TContext>;
|
|
138
|
-
__extensions?: Record<string, any>;
|
|
139
|
-
__astNode?: ObjectTypeDefinitionNode;
|
|
140
|
-
__extensionASTNodes?: ObjectTypeExtensionNode;
|
|
141
|
-
};
|
|
142
|
-
export declare type IInterfaceTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
|
143
|
-
[key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
|
|
144
|
-
} & {
|
|
145
|
-
__name?: string;
|
|
146
|
-
__description?: string;
|
|
147
|
-
__resolveType?: GraphQLTypeResolver<any, any>;
|
|
148
|
-
__extensions?: Record<string, any>;
|
|
149
|
-
__astNode?: InterfaceTypeDefinitionNode;
|
|
150
|
-
__extensionASTNodes?: Array<InterfaceTypeExtensionNode>;
|
|
151
|
-
};
|
|
152
|
-
export declare type IUnionTypeResolver = {
|
|
153
|
-
__name?: string;
|
|
154
|
-
__description?: string;
|
|
155
|
-
__resolveType?: GraphQLTypeResolver<any, any>;
|
|
156
|
-
__extensions?: Record<string, any>;
|
|
157
|
-
__astNode?: UnionTypeDefinitionNode;
|
|
158
|
-
__extensionASTNodes?: Array<UnionTypeExtensionNode>;
|
|
159
|
-
};
|
|
160
|
-
export declare type IInputObjectTypeResolver = {
|
|
161
|
-
__name?: string;
|
|
162
|
-
__description?: string;
|
|
163
|
-
__extensions?: Record<string, any>;
|
|
164
|
-
__astNode?: InputObjectTypeDefinitionNode;
|
|
165
|
-
__extensionASTNodes?: Array<InputObjectTypeExtensionNode>;
|
|
166
|
-
};
|
|
167
|
-
export declare type ISchemaLevelResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = IFieldResolver<TSource, TContext, TArgs, TReturn>;
|
|
168
|
-
export declare type IResolvers<TSource = any, TContext = any, TArgs = Record<string, any>, TReturn = any> = Record<string, ISchemaLevelResolver<TSource, TContext, TArgs, TReturn> | IObjectTypeResolver<TSource, TContext> | IInterfaceTypeResolver<TSource, TContext> | IUnionTypeResolver | IScalarTypeResolver | IEnumTypeResolver | IInputObjectTypeResolver>;
|
|
169
|
-
export declare type IFieldIteratorFn = (fieldDef: GraphQLField<any, any>, typeName: string, fieldName: string) => void;
|
|
170
|
-
export declare type IDefaultValueIteratorFn = (type: GraphQLInputType, value: any) => void;
|
|
171
|
-
export declare type NextResolverFn = () => Promise<any>;
|
|
172
|
-
export declare type VisitableSchemaType = GraphQLSchema | GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType | GraphQLNamedType | GraphQLScalarType | GraphQLField<any, any> | GraphQLInputField | GraphQLArgument | GraphQLUnionType | GraphQLEnumType | GraphQLEnumValue;
|
|
173
|
-
export declare enum MapperKind {
|
|
174
|
-
TYPE = "MapperKind.TYPE",
|
|
175
|
-
SCALAR_TYPE = "MapperKind.SCALAR_TYPE",
|
|
176
|
-
ENUM_TYPE = "MapperKind.ENUM_TYPE",
|
|
177
|
-
COMPOSITE_TYPE = "MapperKind.COMPOSITE_TYPE",
|
|
178
|
-
OBJECT_TYPE = "MapperKind.OBJECT_TYPE",
|
|
179
|
-
INPUT_OBJECT_TYPE = "MapperKind.INPUT_OBJECT_TYPE",
|
|
180
|
-
ABSTRACT_TYPE = "MapperKind.ABSTRACT_TYPE",
|
|
181
|
-
UNION_TYPE = "MapperKind.UNION_TYPE",
|
|
182
|
-
INTERFACE_TYPE = "MapperKind.INTERFACE_TYPE",
|
|
183
|
-
ROOT_OBJECT = "MapperKind.ROOT_OBJECT",
|
|
184
|
-
QUERY = "MapperKind.QUERY",
|
|
185
|
-
MUTATION = "MapperKind.MUTATION",
|
|
186
|
-
SUBSCRIPTION = "MapperKind.SUBSCRIPTION",
|
|
187
|
-
DIRECTIVE = "MapperKind.DIRECTIVE",
|
|
188
|
-
FIELD = "MapperKind.FIELD",
|
|
189
|
-
COMPOSITE_FIELD = "MapperKind.COMPOSITE_FIELD",
|
|
190
|
-
OBJECT_FIELD = "MapperKind.OBJECT_FIELD",
|
|
191
|
-
ROOT_FIELD = "MapperKind.ROOT_FIELD",
|
|
192
|
-
QUERY_ROOT_FIELD = "MapperKind.QUERY_ROOT_FIELD",
|
|
193
|
-
MUTATION_ROOT_FIELD = "MapperKind.MUTATION_ROOT_FIELD",
|
|
194
|
-
SUBSCRIPTION_ROOT_FIELD = "MapperKind.SUBSCRIPTION_ROOT_FIELD",
|
|
195
|
-
INTERFACE_FIELD = "MapperKind.INTERFACE_FIELD",
|
|
196
|
-
INPUT_OBJECT_FIELD = "MapperKind.INPUT_OBJECT_FIELD",
|
|
197
|
-
ARGUMENT = "MapperKind.ARGUMENT",
|
|
198
|
-
ENUM_VALUE = "MapperKind.ENUM_VALUE"
|
|
199
|
-
}
|
|
200
|
-
export interface SchemaMapper {
|
|
201
|
-
[MapperKind.TYPE]?: NamedTypeMapper;
|
|
202
|
-
[MapperKind.SCALAR_TYPE]?: ScalarTypeMapper;
|
|
203
|
-
[MapperKind.ENUM_TYPE]?: EnumTypeMapper;
|
|
204
|
-
[MapperKind.COMPOSITE_TYPE]?: CompositeTypeMapper;
|
|
205
|
-
[MapperKind.OBJECT_TYPE]?: ObjectTypeMapper;
|
|
206
|
-
[MapperKind.INPUT_OBJECT_TYPE]?: InputObjectTypeMapper;
|
|
207
|
-
[MapperKind.ABSTRACT_TYPE]?: AbstractTypeMapper;
|
|
208
|
-
[MapperKind.UNION_TYPE]?: UnionTypeMapper;
|
|
209
|
-
[MapperKind.INTERFACE_TYPE]?: InterfaceTypeMapper;
|
|
210
|
-
[MapperKind.ROOT_OBJECT]?: ObjectTypeMapper;
|
|
211
|
-
[MapperKind.QUERY]?: ObjectTypeMapper;
|
|
212
|
-
[MapperKind.MUTATION]?: ObjectTypeMapper;
|
|
213
|
-
[MapperKind.SUBSCRIPTION]?: ObjectTypeMapper;
|
|
214
|
-
[MapperKind.ENUM_VALUE]?: EnumValueMapper;
|
|
215
|
-
[MapperKind.FIELD]?: GenericFieldMapper<GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig>;
|
|
216
|
-
[MapperKind.OBJECT_FIELD]?: FieldMapper;
|
|
217
|
-
[MapperKind.ROOT_FIELD]?: FieldMapper;
|
|
218
|
-
[MapperKind.QUERY_ROOT_FIELD]?: FieldMapper;
|
|
219
|
-
[MapperKind.MUTATION_ROOT_FIELD]?: FieldMapper;
|
|
220
|
-
[MapperKind.SUBSCRIPTION_ROOT_FIELD]?: FieldMapper;
|
|
221
|
-
[MapperKind.INTERFACE_FIELD]?: FieldMapper;
|
|
222
|
-
[MapperKind.COMPOSITE_FIELD]?: FieldMapper;
|
|
223
|
-
[MapperKind.ARGUMENT]?: ArgumentMapper;
|
|
224
|
-
[MapperKind.INPUT_OBJECT_FIELD]?: InputFieldMapper;
|
|
225
|
-
[MapperKind.DIRECTIVE]?: DirectiveMapper;
|
|
226
|
-
}
|
|
227
|
-
export declare type SchemaFieldMapperTypes = Array<MapperKind.FIELD | MapperKind.COMPOSITE_FIELD | MapperKind.OBJECT_FIELD | MapperKind.ROOT_FIELD | MapperKind.QUERY_ROOT_FIELD | MapperKind.MUTATION_ROOT_FIELD | MapperKind.SUBSCRIPTION_ROOT_FIELD | MapperKind.INTERFACE_FIELD | MapperKind.INPUT_OBJECT_FIELD>;
|
|
228
|
-
export declare type NamedTypeMapper = (type: GraphQLNamedType, schema: GraphQLSchema) => GraphQLNamedType | null | undefined;
|
|
229
|
-
export declare type ScalarTypeMapper = (type: GraphQLScalarType, schema: GraphQLSchema) => GraphQLScalarType | null | undefined;
|
|
230
|
-
export declare type EnumTypeMapper = (type: GraphQLEnumType, schema: GraphQLSchema) => GraphQLEnumType | null | undefined;
|
|
231
|
-
export declare type EnumValueMapper = (valueConfig: GraphQLEnumValueConfig, typeName: string, schema: GraphQLSchema, externalValue: string) => GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined;
|
|
232
|
-
export declare type CompositeTypeMapper = (type: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined;
|
|
233
|
-
export declare type ObjectTypeMapper = (type: GraphQLObjectType, schema: GraphQLSchema) => GraphQLObjectType | null | undefined;
|
|
234
|
-
export declare type InputObjectTypeMapper = (type: GraphQLInputObjectType, schema: GraphQLSchema) => GraphQLInputObjectType | null | undefined;
|
|
235
|
-
export declare type AbstractTypeMapper = (type: GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLInterfaceType | GraphQLUnionType | null | undefined;
|
|
236
|
-
export declare type UnionTypeMapper = (type: GraphQLUnionType, schema: GraphQLSchema) => GraphQLUnionType | null | undefined;
|
|
237
|
-
export declare type InterfaceTypeMapper = (type: GraphQLInterfaceType, schema: GraphQLSchema) => GraphQLInterfaceType | null | undefined;
|
|
238
|
-
export declare type DirectiveMapper = (directive: GraphQLDirective, schema: GraphQLSchema) => GraphQLDirective | null | undefined;
|
|
239
|
-
export declare type GenericFieldMapper<F extends GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig> = (fieldConfig: F, fieldName: string, typeName: string, schema: GraphQLSchema) => F | [string, F] | null | undefined;
|
|
240
|
-
export declare type FieldMapper = GenericFieldMapper<GraphQLFieldConfig<any, any>>;
|
|
241
|
-
export declare type ArgumentMapper = (argumentConfig: GraphQLArgumentConfig, fieldName: string, typeName: string, schema: GraphQLSchema) => GraphQLArgumentConfig | [string, GraphQLArgumentConfig] | null | undefined;
|
|
242
|
-
export declare type InputFieldMapper = GenericFieldMapper<GraphQLInputFieldConfig>;
|
package/es5/addTypes.d.ts
DELETED
package/es5/astFromType.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ValueNode } from 'graphql';
|
|
2
|
-
/**
|
|
3
|
-
* Produces a GraphQL Value AST given a JavaScript object.
|
|
4
|
-
* Function will match JavaScript/JSON values to GraphQL AST schema format
|
|
5
|
-
* by using the following mapping.
|
|
6
|
-
*
|
|
7
|
-
* | JSON Value | GraphQL Value |
|
|
8
|
-
* | ------------- | -------------------- |
|
|
9
|
-
* | Object | Input Object |
|
|
10
|
-
* | Array | List |
|
|
11
|
-
* | Boolean | Boolean |
|
|
12
|
-
* | String | String |
|
|
13
|
-
* | Number | Int / Float |
|
|
14
|
-
* | null | NullValue |
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
export declare function astFromValueUntyped(value: any): ValueNode | null;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { GraphQLSchema, OperationDefinitionNode, OperationTypeNode } from 'graphql';
|
|
2
|
-
export declare type Skip = string[];
|
|
3
|
-
export declare type Force = string[];
|
|
4
|
-
export declare type Ignore = string[];
|
|
5
|
-
export declare type SelectedFields = {
|
|
6
|
-
[key: string]: SelectedFields;
|
|
7
|
-
} | boolean;
|
|
8
|
-
export declare function buildOperationNodeForField({ schema, kind, field, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, }: {
|
|
9
|
-
schema: GraphQLSchema;
|
|
10
|
-
kind: OperationTypeNode;
|
|
11
|
-
field: string;
|
|
12
|
-
models?: string[];
|
|
13
|
-
ignore?: Ignore;
|
|
14
|
-
depthLimit?: number;
|
|
15
|
-
circularReferenceDepth?: number;
|
|
16
|
-
argNames?: string[];
|
|
17
|
-
selectedFields?: SelectedFields;
|
|
18
|
-
}): OperationDefinitionNode;
|
package/es5/collectFields.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GraphQLSchema, FragmentDefinitionNode, GraphQLObjectType, SelectionSetNode, FieldNode } from 'graphql';
|
|
2
|
-
export declare function collectFields(schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: {
|
|
3
|
-
[variable: string]: unknown;
|
|
4
|
-
}, runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode, fields: Map<string, Array<FieldNode>>, visitedFragmentNames: Set<string>): Map<string, Array<FieldNode>>;
|
|
5
|
-
export declare const collectSubFields: (schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: Record<string, any>, type: GraphQLObjectType, fieldNodes: Array<FieldNode>) => Map<string, Array<FieldNode>>;
|
package/es5/comments.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { StringValueNode, ASTNode, NameNode, DefinitionNode, Location } from 'graphql';
|
|
2
|
-
export declare type NamedDefinitionNode = DefinitionNode & {
|
|
3
|
-
name?: NameNode;
|
|
4
|
-
};
|
|
5
|
-
export declare function resetComments(): void;
|
|
6
|
-
export declare function collectComment(node: NamedDefinitionNode): void;
|
|
7
|
-
export declare function pushComment(node: any, entity: string, field?: string, argument?: string): void;
|
|
8
|
-
export declare function printComment(comment: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Converts an AST into a string, using one set of reasonable
|
|
11
|
-
* formatting rules.
|
|
12
|
-
*/
|
|
13
|
-
export declare function printWithComments(ast: ASTNode): string;
|
|
14
|
-
export declare function getDescription(node: {
|
|
15
|
-
description?: StringValueNode;
|
|
16
|
-
loc?: Location;
|
|
17
|
-
}, options?: {
|
|
18
|
-
commentDescriptions?: boolean;
|
|
19
|
-
}): string | undefined;
|
|
20
|
-
export declare function getLeadingCommentBlock(node: {
|
|
21
|
-
description?: StringValueNode;
|
|
22
|
-
loc?: Location;
|
|
23
|
-
}): void | string;
|
|
24
|
-
export declare function dedentBlockStringValue(rawString: string): string;
|
|
25
|
-
/**
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
export declare function getBlockStringIndentation(lines: ReadonlyArray<string>): number;
|
package/es5/errors.d.ts
DELETED
package/es5/executor.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ExecutionResult, ExecutionRequest } from './Interfaces';
|
|
2
|
-
declare type MaybePromise<T> = Promise<T> | T;
|
|
3
|
-
declare type MaybeAsyncIterableIterator<T> = AsyncIterableIterator<T> | T;
|
|
4
|
-
export declare type AsyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => Promise<MaybeAsyncIterableIterator<ExecutionResult<TReturn>>>;
|
|
5
|
-
export declare type SyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => ExecutionResult<TReturn>;
|
|
6
|
-
export declare type Executor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => MaybePromise<MaybeAsyncIterableIterator<ExecutionResult<TReturn>>>;
|
|
7
|
-
export {};
|
package/es5/fields.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GraphQLFieldConfigMap, GraphQLFieldConfig, GraphQLSchema } from 'graphql';
|
|
2
|
-
export declare function appendObjectFields(schema: GraphQLSchema, typeName: string, additionalFields: GraphQLFieldConfigMap<any, any>): GraphQLSchema;
|
|
3
|
-
export declare function removeObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean): [GraphQLSchema, GraphQLFieldConfigMap<any, any>];
|
|
4
|
-
export declare function selectObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean): GraphQLFieldConfigMap<any, any>;
|
|
5
|
-
export declare function modifyObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean, newFields: GraphQLFieldConfigMap<any, any>): [GraphQLSchema, GraphQLFieldConfigMap<any, any>];
|