@envelop/fragment-arguments 9.1.1 → 9.2.0
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/LICENSE +3 -1
- package/cjs/extended-parser.js +2 -1
- package/cjs/utils.js +1 -1
- package/esm/extended-parser.js +3 -2
- package/esm/utils.js +2 -2
- package/package.json +5 -5
- package/typings/extended-parser.d.cts +4 -2
- package/typings/extended-parser.d.ts +4 -2
- package/typings/utils.d.cts +1 -1
- package/typings/utils.d.ts +1 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2020
|
|
3
|
+
Copyright (c) 2018-2020 Graphcool
|
|
4
|
+
Copyright (c) 2020-2021 Prisma
|
|
5
|
+
Copyright (c) 2021- The Guild
|
|
4
6
|
|
|
5
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
8
|
of this software and associated documentation files (the "Software"), to deal
|
package/cjs/extended-parser.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FragmentArgumentCompatibleParser = void 0;
|
|
4
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
5
4
|
const graphql_1 = require("graphql");
|
|
6
5
|
const parser_js_1 = require("graphql/language/parser.js");
|
|
7
6
|
class FragmentArgumentCompatibleParser extends parser_js_1.Parser {
|
|
@@ -14,6 +13,8 @@ class FragmentArgumentCompatibleParser extends parser_js_1.Parser {
|
|
|
14
13
|
return this._options;
|
|
15
14
|
}
|
|
16
15
|
// for backwards-compat with v15, this api was removed in v16 in favor of the this.node API.
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
|
+
// @ts-ignore
|
|
17
18
|
loc(startToken) {
|
|
18
19
|
if (this.getOptions()?.noLocation !== true) {
|
|
19
20
|
const lexer = this.getLexer();
|
package/cjs/utils.js
CHANGED
|
@@ -14,7 +14,7 @@ function applySelectionSetFragmentArguments(document) {
|
|
|
14
14
|
FragmentSpread(fragmentNode) {
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
16
16
|
// @ts-ignore
|
|
17
|
-
if (fragmentNode.arguments
|
|
17
|
+
if (fragmentNode.arguments?.length) {
|
|
18
18
|
const fragmentDef = fragmentList.get(fragmentNode.name.value);
|
|
19
19
|
if (!fragmentDef) {
|
|
20
20
|
return;
|
package/esm/extended-parser.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Kind, Location, TokenKind, } from 'graphql';
|
|
1
|
+
import { Kind, Location, TokenKind } from 'graphql';
|
|
3
2
|
import { Parser } from 'graphql/language/parser.js';
|
|
4
3
|
export class FragmentArgumentCompatibleParser extends Parser {
|
|
5
4
|
// see https://github.com/graphql/graphql-js/pull/3248
|
|
@@ -11,6 +10,8 @@ export class FragmentArgumentCompatibleParser extends Parser {
|
|
|
11
10
|
return this._options;
|
|
12
11
|
}
|
|
13
12
|
// for backwards-compat with v15, this api was removed in v16 in favor of the this.node API.
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14
|
+
// @ts-ignore
|
|
14
15
|
loc(startToken) {
|
|
15
16
|
if (this.getOptions()?.noLocation !== true) {
|
|
16
17
|
const lexer = this.getLexer();
|
package/esm/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Kind, visit
|
|
1
|
+
import { Kind, visit } from 'graphql';
|
|
2
2
|
export function applySelectionSetFragmentArguments(document) {
|
|
3
3
|
const fragmentList = new Map();
|
|
4
4
|
for (const def of document.definitions) {
|
|
@@ -11,7 +11,7 @@ export function applySelectionSetFragmentArguments(document) {
|
|
|
11
11
|
FragmentSpread(fragmentNode) {
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
13
|
// @ts-ignore
|
|
14
|
-
if (fragmentNode.arguments
|
|
14
|
+
if (fragmentNode.arguments?.length) {
|
|
15
15
|
const fragmentDef = fragmentList.get(fragmentNode.name.value);
|
|
16
16
|
if (!fragmentDef) {
|
|
17
17
|
return;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/fragment-arguments",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
6
|
-
"@envelop/core": "^5.
|
|
5
|
+
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
6
|
+
"@envelop/core": "^5.6.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"tslib": "^2.5.0"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "https://github.com/graphql-hive/
|
|
14
|
-
"directory": "packages/plugins/fragment-arguments"
|
|
13
|
+
"url": "https://github.com/graphql-hive/graphql-yoga.git",
|
|
14
|
+
"directory": "packages/envelop/plugins/fragment-arguments"
|
|
15
15
|
},
|
|
16
16
|
"author": "Dotan Simha <dotansimha@gmail.com>",
|
|
17
17
|
"license": "MIT",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { FragmentDefinitionNode, FragmentSpreadNode, InlineFragmentNode,
|
|
1
|
+
import type { FragmentDefinitionNode, FragmentSpreadNode, InlineFragmentNode, Token } from 'graphql';
|
|
2
|
+
import { Location } from 'graphql';
|
|
2
3
|
import type { Lexer } from 'graphql/language/lexer.cjs';
|
|
3
|
-
import { ParseOptions
|
|
4
|
+
import type { ParseOptions } from 'graphql/language/parser.cjs';
|
|
5
|
+
import { Parser } from 'graphql/language/parser.cjs';
|
|
4
6
|
export declare class FragmentArgumentCompatibleParser extends Parser {
|
|
5
7
|
getLexer(): Lexer;
|
|
6
8
|
getOptions(): ParseOptions;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { FragmentDefinitionNode, FragmentSpreadNode, InlineFragmentNode,
|
|
1
|
+
import type { FragmentDefinitionNode, FragmentSpreadNode, InlineFragmentNode, Token } from 'graphql';
|
|
2
|
+
import { Location } from 'graphql';
|
|
2
3
|
import type { Lexer } from 'graphql/language/lexer.js';
|
|
3
|
-
import { ParseOptions
|
|
4
|
+
import type { ParseOptions } from 'graphql/language/parser.js';
|
|
5
|
+
import { Parser } from 'graphql/language/parser.js';
|
|
4
6
|
export declare class FragmentArgumentCompatibleParser extends Parser {
|
|
5
7
|
getLexer(): Lexer;
|
|
6
8
|
getOptions(): ParseOptions;
|
package/typings/utils.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DocumentNode } from 'graphql';
|
|
1
|
+
import type { DocumentNode } from 'graphql';
|
|
2
2
|
export declare function applySelectionSetFragmentArguments(document: DocumentNode): DocumentNode | Error;
|
package/typings/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DocumentNode } from 'graphql';
|
|
1
|
+
import type { DocumentNode } from 'graphql';
|
|
2
2
|
export declare function applySelectionSetFragmentArguments(document: DocumentNode): DocumentNode | Error;
|