Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: graphql/graphql-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v14.5.3
Choose a base ref
...
head repository: graphql/graphql-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v14.5.4
Choose a head ref
  • 11 commits
  • 16 files changed
  • 3 contributors

Commits on Aug 26, 2019

  1. fix: added FlowFixMe on Array.prototype.flatMap (#2131)

    - Fix for flow-bin 0.96, which complains about flatMap not existing.
    Michael-M-Judd authored and IvanGoncharov committed Aug 26, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d884237 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    darrachequesne Damien Arrachequesne
    Copy the full SHA
    175f989 View commit details

Commits on Aug 27, 2019

  1. tstypes: Use any as BREAK type. (#2135)

    Otherwise, TS will reposrt errors when a visit function only conditionally returns BREAK (not all paths return a value error)
    Jackson Kearl authored and IvanGoncharov committed Aug 27, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    darrachequesne Damien Arrachequesne
    Copy the full SHA
    27e855a View commit details
  2. void => undefined in Path.d.ts (#2134)

    Jackson Kearl authored and IvanGoncharov committed Aug 27, 2019
    Copy the full SHA
    3e9c191 View commit details
  3. Copy the full SHA
    8ab6524 View commit details
  4. Copy the full SHA
    85d4c99 View commit details

Commits on Aug 28, 2019

  1. Add index.d.ts as "types" field of package.json.

    Jackson Kearl authored and IvanGoncharov committed Aug 28, 2019
    Copy the full SHA
    eff2a60 View commit details
  2. Replace index imports with specific paths

    Jackson Kearl authored and IvanGoncharov committed Aug 28, 2019
    Copy the full SHA
    6f341a3 View commit details

Commits on Aug 29, 2019

  1. Markoptions in getVariableValues(...) optional (#2142)

    Jackson Kearl authored and IvanGoncharov committed Aug 29, 2019
    Copy the full SHA
    37cbb6a View commit details
  2. Copy the full SHA
    d008e96 View commit details
  3. v14.5.4

    IvanGoncharov committed Aug 29, 2019
    Copy the full SHA
    0d2220f View commit details
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "graphql",
"version": "14.5.3",
"version": "14.5.4",
"description": "A Query Language and Runtime which can target any service.",
"license": "MIT",
"private": true,
"main": "index",
"module": "index.mjs",
"types": "index.d.ts",
"sideEffects": false,
"homepage": "https://github.com/graphql/graphql-js",
"bugs": {
7 changes: 5 additions & 2 deletions src/polyfills/flatMap.js
Original file line number Diff line number Diff line change
@@ -5,11 +5,14 @@ declare function flatMap<T, U>(
fn: (item: T, index: number) => $ReadOnlyArray<U> | U,
): Array<U>;

// Workaround to make older Flow versions happy
const flatMapMethod = (Array.prototype: any).flatMap;

/* eslint-disable no-redeclare */
// $FlowFixMe
const flatMap = Array.prototype.flatMap
const flatMap = flatMapMethod
? function(list, fn) {
return Array.prototype.flatMap.call(list, fn);
return flatMapMethod.call(list, fn);
}
: function(list, fn) {
let result = [];
9 changes: 5 additions & 4 deletions src/polyfills/isFinite.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// @flow strict

declare function isFinite(value: mixed): boolean %checks(typeof value ===
'number');
declare function isFinitePolyfill(
value: mixed,
): boolean %checks(typeof value === 'number');

/* eslint-disable no-redeclare */
// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441
const isFinite =
const isFinitePolyfill =
Number.isFinite ||
function(value) {
return typeof value === 'number' && isFinite(value);
};
export default isFinite;
export default isFinitePolyfill;
70 changes: 40 additions & 30 deletions src/type/__tests__/extensions-test.js
Original file line number Diff line number Diff line change
@@ -18,6 +18,12 @@ import {

const dummyType = new GraphQLScalarType({ name: 'DummyScalar' });

function expectObjMap(value) {
invariant(value != null && typeof value === 'object');
expect(Object.getPrototypeOf(value)).to.equal(null);
return expect(value);
}

describe('Type System: Extensions', () => {
describe('GraphQLScalarType', () => {
it('without extensions', () => {
@@ -35,10 +41,10 @@ describe('Type System: Extensions', () => {
extensions: scalarExtensions,
});

expect(someScalar.extensions).to.deep.equal(scalarExtensions);
expectObjMap(someScalar.extensions).to.deep.equal(scalarExtensions);

const config = someScalar.toConfig();
expect(config.extensions).to.deep.equal(scalarExtensions);
expectObjMap(config.extensions).to.deep.equal(scalarExtensions);
});
});

@@ -95,19 +101,19 @@ describe('Type System: Extensions', () => {
extensions: objectExtensions,
});

expect(someObject.extensions).to.deep.equal(objectExtensions);
expectObjMap(someObject.extensions).to.deep.equal(objectExtensions);
const someField = someObject.getFields().someField;
expect(someField.extensions).to.deep.equal(fieldExtensions);
expectObjMap(someField.extensions).to.deep.equal(fieldExtensions);
const someArg = someField.args[0];
expect(someArg.extensions).to.deep.equal(argExtensions);
expectObjMap(someArg.extensions).to.deep.equal(argExtensions);

const config = someObject.toConfig();
expect(config.extensions).to.deep.equal(objectExtensions);
expectObjMap(config.extensions).to.deep.equal(objectExtensions);
const someFieldConfig = config.fields.someField;
expect(someFieldConfig.extensions).to.deep.equal(fieldExtensions);
expectObjMap(someFieldConfig.extensions).to.deep.equal(fieldExtensions);
invariant(someFieldConfig.args);
const someArgConfig = someFieldConfig.args.someArg;
expect(someArgConfig.extensions).to.deep.equal(argExtensions);
expectObjMap(someArgConfig.extensions).to.deep.equal(argExtensions);
});
});

@@ -164,19 +170,19 @@ describe('Type System: Extensions', () => {
extensions: interfaceExtensions,
});

expect(someInterface.extensions).to.deep.equal(interfaceExtensions);
expectObjMap(someInterface.extensions).to.deep.equal(interfaceExtensions);
const someField = someInterface.getFields().someField;
expect(someField.extensions).to.deep.equal(fieldExtensions);
expectObjMap(someField.extensions).to.deep.equal(fieldExtensions);
const someArg = someField.args[0];
expect(someArg.extensions).to.deep.equal(argExtensions);
expectObjMap(someArg.extensions).to.deep.equal(argExtensions);

const config = someInterface.toConfig();
expect(config.extensions).to.deep.equal(interfaceExtensions);
expectObjMap(config.extensions).to.deep.equal(interfaceExtensions);
const someFieldConfig = config.fields.someField;
expect(someFieldConfig.extensions).to.deep.equal(fieldExtensions);
expectObjMap(someFieldConfig.extensions).to.deep.equal(fieldExtensions);
invariant(someFieldConfig.args);
const someArgConfig = someFieldConfig.args.someArg;
expect(someArgConfig.extensions).to.deep.equal(argExtensions);
expectObjMap(someArgConfig.extensions).to.deep.equal(argExtensions);
});
});

@@ -202,10 +208,10 @@ describe('Type System: Extensions', () => {
extensions: unionExtensions,
});

expect(someUnion.extensions).to.deep.equal(unionExtensions);
expectObjMap(someUnion.extensions).to.deep.equal(unionExtensions);

const config = someUnion.toConfig();
expect(config.extensions).to.deep.equal(unionExtensions);
expectObjMap(config.extensions).to.deep.equal(unionExtensions);
});
});

@@ -242,14 +248,14 @@ describe('Type System: Extensions', () => {
extensions: enumExtensions,
});

expect(someEnum.extensions).to.deep.equal(enumExtensions);
expectObjMap(someEnum.extensions).to.deep.equal(enumExtensions);
const someValue = someEnum.getValues()[0];
expect(someValue.extensions).to.deep.equal(valueExtensions);
expectObjMap(someValue.extensions).to.deep.equal(valueExtensions);

const config = someEnum.toConfig();
expect(config.extensions).to.deep.equal(enumExtensions);
expectObjMap(config.extensions).to.deep.equal(enumExtensions);
const someValueConfig = config.values.SOME_VALUE;
expect(someValueConfig.extensions).to.deep.equal(valueExtensions);
expectObjMap(someValueConfig.extensions).to.deep.equal(valueExtensions);
});
});

@@ -293,14 +299,18 @@ describe('Type System: Extensions', () => {
extensions: inputObjectExtensions,
});

expect(someInputObject.extensions).to.deep.equal(inputObjectExtensions);
expectObjMap(someInputObject.extensions).to.deep.equal(
inputObjectExtensions,
);
const someInputField = someInputObject.getFields().someInputField;
expect(someInputField.extensions).to.deep.equal(inputFieldExtensions);
expectObjMap(someInputField.extensions).to.deep.equal(
inputFieldExtensions,
);

const config = someInputObject.toConfig();
expect(config.extensions).to.deep.equal(inputObjectExtensions);
expectObjMap(config.extensions).to.deep.equal(inputObjectExtensions);
const someInputFieldConfig = config.fields.someInputField;
expect(someInputFieldConfig.extensions).to.deep.equal(
expectObjMap(someInputFieldConfig.extensions).to.deep.equal(
inputFieldExtensions,
);
});
@@ -346,14 +356,14 @@ describe('Type System: Extensions', () => {
extensions: directiveExtensions,
});

expect(someDirective.extensions).to.deep.equal(directiveExtensions);
expectObjMap(someDirective.extensions).to.deep.equal(directiveExtensions);
const someArg = someDirective.args[0];
expect(someArg.extensions).to.deep.equal(argExtensions);
expectObjMap(someArg.extensions).to.deep.equal(argExtensions);

const config = someDirective.toConfig();
expect(config.extensions).to.deep.equal(directiveExtensions);
expectObjMap(config.extensions).to.deep.equal(directiveExtensions);
const someArgConfig = config.args.someArg;
expect(someArgConfig.extensions).to.deep.equal(argExtensions);
expectObjMap(someArgConfig.extensions).to.deep.equal(argExtensions);
});
});

@@ -374,10 +384,10 @@ describe('Type System: Extensions', () => {

const schema = new GraphQLSchema({ extensions: schemaExtensions });

expect(schema.extensions).to.deep.equal(schemaExtensions);
expectObjMap(schema.extensions).to.deep.equal(schemaExtensions);

const config = schema.toConfig();
expect(config.extensions).to.deep.equal(schemaExtensions);
expectObjMap(config.extensions).to.deep.equal(schemaExtensions);
});
});
});
2 changes: 1 addition & 1 deletion src/type/directives.js
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ export class GraphQLDirective {
description: arg.description === undefined ? null : arg.description,
type: arg.type,
defaultValue: arg.defaultValue,
extensions: arg.extensions,
extensions: arg.extensions && toObjMap(arg.extensions),
astNode: arg.astNode,
}));
}
4 changes: 2 additions & 2 deletions src/version.js
Original file line number Diff line number Diff line change
@@ -8,14 +8,14 @@
/**
* A string containing the version of the GraphQL.js library
*/
export const version = '14.5.3';
export const version = '14.5.4';

/**
* An object containing the components of the GraphQL.js version string
*/
export const versionInfo = Object.freeze({
major: 14,
minor: 5,
patch: 3,
patch: 4,
preReleaseTag: null,
});
4 changes: 3 additions & 1 deletion tstypes/execution/execute.d.ts
Original file line number Diff line number Diff line change
@@ -2,7 +2,9 @@ import Maybe from '../tsutils/Maybe';
import { PromiseOrValue } from '../jsutils/PromiseOrValue';
import { Path, addPath, pathToArray } from '../jsutils/Path';

import { GraphQLError, locatedError } from '../error';
import { GraphQLError } from '../error/GraphQLError';
import { locatedError } from '../error/locatedError';

import {
DirectiveNode,
DocumentNode,
2 changes: 1 addition & 1 deletion tstypes/execution/values.d.ts
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ export function getVariableValues(
schema: GraphQLSchema,
varDefNodes: VariableDefinitionNode[],
inputs: { [key: string]: any },
options: { maxErrors?: number },
options?: { maxErrors?: number },
): CoercedVariableValues;

/**
2 changes: 1 addition & 1 deletion tstypes/jsutils/Path.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type Path = {
prev: Path | void;
prev: Path | undefined;
key: string | number;
};

2 changes: 1 addition & 1 deletion tstypes/language/visitor.d.ts
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ export const QueryDocumentKeys: {
InputObjectTypeExtension: ['name', 'directives', 'fields'];
};

export const BREAK: {};
export const BREAK: any;

/**
* visit() will walk through an AST using a depth first traversal, calling
4 changes: 3 additions & 1 deletion tstypes/subscription/mapAsyncIterator.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { PromiseOrValue } from '../jsutils/PromiseOrValue';

/**
* Given an AsyncIterable and a callback function, return an AsyncIterator
* which produces values mapped via calling the callback function.
@@ -6,4 +8,4 @@ export default function mapAsyncIterator<T, U>(
iterable: AsyncIterable<T>,
callback: (arg: T) => PromiseOrValue<U>,
rejectCallback?: (arg: any) => PromiseOrValue<U>,
): AsyncGenerator<U, void, void>;
): any; // TS_SPECIFIC: es2018.asyncgenerator requires typescript@3.6
2 changes: 1 addition & 1 deletion tstypes/utilities/coerceInputValue.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GraphQLInputType } from '../type/definition';
import { GraphQLError } from '../error';
import { GraphQLError } from '../error/GraphQLError';

type OnErrorCB = (
path: ReadonlyArray<string | number>,
2 changes: 1 addition & 1 deletion tstypes/validation/ValidationContext.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Maybe from '../tsutils/Maybe';
import { GraphQLError } from '../error';
import { GraphQLError } from '../error/GraphQLError';
import { ASTVisitor } from '../language/visitor';
import {
DocumentNode,
2 changes: 1 addition & 1 deletion tstypes/validation/rules/PossibleTypeExtensions.d.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { SDLValidationContext } from '../ValidationContext';

export function extendingUnknownTypeMessage(
typeName: string,
suggestedTypes: $ReadOnlyArray<string>,
suggestedTypes: ReadonlyArray<string>,
): string;

export function extendingDifferentTypeKindMessage(
2 changes: 1 addition & 1 deletion tstypes/validation/rules/UniqueDirectiveNames.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTVisitor } from '../../language/visitor';
import { ASTValidationContext } from '../ValidationContext';
import { SDLValidationContext } from '../ValidationContext';

export function duplicateDirectiveNameMessage(directiveName: string): string;

2 changes: 1 addition & 1 deletion tstypes/validation/validate.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GraphQLError } from '../error';
import { GraphQLError } from '../error/GraphQLError';
import { DocumentNode } from '../language/ast';
import { GraphQLSchema } from '../type/schema';
import { TypeInfo } from '../utilities/TypeInfo';