Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- `apollo-env`
- <First `apollo-env` related entry goes here>
- `apollo-graphql`
- <First `apollo-graphql` related entry goes here>
- remove flat polyfill, use Array.prototype.flat instead [PR #2449](https://github.com/apollographql/apollo-tooling/pull/2449)
- `apollo-language-server`
- <First `apollo-language-server` related entry goes here>
- `apollo-tools`
Expand All @@ -33,7 +33,7 @@

## [email protected]

- Adds support for àpollo.config.cjs`files allowing `package.json` files with `type: "module"` [Issue #2342](https://github.com/apollographql/apollo-tooling/issues/2342) [PR #2381](https://github.com/apollographql/apollo-tooling/pull/2381)
- Adds support for àpollo.config.cjs`files allowing`package.json`files with`type: "module"` [Issue #2342](https://github.com/apollographql/apollo-tooling/issues/2342) [PR #2381](https://github.com/apollographql/apollo-tooling/pull/2381)

## [email protected]

Expand Down
3 changes: 1 addition & 2 deletions packages/apollo-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
"author": "Apollo <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=6"
"node": ">=12"
},
"dependencies": {
"core-js-pure": "^3.10.2",
"lodash.sortby": "^4.7.0",
"sha.js": "^2.4.11"
},
Expand Down
18 changes: 6 additions & 12 deletions packages/apollo-graphql/src/schema/buildSchemaFromSDL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ import { GraphQLResolverMap } from "./resolverMap";
import { GraphQLSchemaValidationError } from "./GraphQLSchemaValidationError";
import { specifiedSDLRules } from "graphql/validation/specifiedRules";

// TODO(Node.js 10): When we deprecate Node.js 10, remove this and switch
// to using `Array.prototype.flat`. When doing this, deleting the hand-rolled
// types in `./packages/apollo-gateway/src/types/` that go with it.
import flat from "core-js-pure/features/array/flat";

import {
KnownTypeNamesRule,
UniqueDirectivesPerLocationRule,
Expand Down Expand Up @@ -162,7 +157,7 @@ export function buildSchemaFromSDL(
{
kind: Kind.DOCUMENT,
definitions: [
...flat(Object.values(definitionsMap)),
...Object.values(definitionsMap).flat(),
...missingTypeDefinitions,
...directiveDefinitions
]
Expand All @@ -176,7 +171,7 @@ export function buildSchemaFromSDL(
schema,
{
kind: Kind.DOCUMENT,
definitions: flat(Object.values(extensionsMap))
definitions: Object.values(extensionsMap).flat()
},
{
assumeValidSDL: true
Expand All @@ -188,11 +183,10 @@ export function buildSchemaFromSDL(
if (schemaDefinitions.length > 0 || schemaExtensions.length > 0) {
operationTypeMap = {};

const operationTypes = flat(
[...schemaDefinitions, ...schemaExtensions]
.map(node => node.operationTypes)
.filter(isNotNullOrUndefined)
);
const operationTypes = [...schemaDefinitions, ...schemaExtensions]
.map(node => node.operationTypes)
.filter(isNotNullOrUndefined)
.flat();

for (const { operation, type } of operationTypes) {
operationTypeMap[operation] = type.name.value;
Expand Down
7 changes: 0 additions & 7 deletions packages/apollo-graphql/src/types/core-js-pure.d.ts

This file was deleted.