@envelop/fragment-arguments 1.1.0-alpha-290f8ac.0 → 1.1.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.
@@ -1,50 +1,10 @@
1
1
  import { ParseOptions, Parser } from 'graphql/language/parser.js';
2
2
  import type { Lexer } from 'graphql/language/lexer.js';
3
- import { Token, Location } from 'graphql';
3
+ import { Token, Location, FragmentDefinitionNode, FragmentSpreadNode, InlineFragmentNode } from 'graphql';
4
4
  export declare class FragmentArgumentCompatibleParser extends Parser {
5
5
  getLexer(): Lexer;
6
6
  getOptions(): ParseOptions;
7
7
  loc(startToken: Token): Location | undefined;
8
- parseFragment(): {
9
- kind: "FragmentSpread";
10
- name: import("graphql").NameNode;
11
- arguments: import("graphql").ArgumentNode[];
12
- directives: import("graphql").DirectiveNode[];
13
- loc: Location | undefined;
14
- typeCondition?: undefined;
15
- selectionSet?: undefined;
16
- } | {
17
- kind: "FragmentSpread";
18
- name: import("graphql").NameNode;
19
- directives: import("graphql").DirectiveNode[];
20
- loc: Location | undefined;
21
- arguments?: undefined;
22
- typeCondition?: undefined;
23
- selectionSet?: undefined;
24
- } | {
25
- kind: "InlineFragment";
26
- typeCondition: import("graphql").NamedTypeNode | undefined;
27
- directives: import("graphql").DirectiveNode[];
28
- selectionSet: import("graphql").SelectionSetNode;
29
- loc: Location | undefined;
30
- name?: undefined;
31
- arguments?: undefined;
32
- };
33
- parseFragmentDefinition(): {
34
- kind: "FragmentDefinition";
35
- name: import("graphql").NameNode;
36
- variableDefinitions: import("graphql").VariableDefinitionNode[];
37
- typeCondition: import("graphql").NamedTypeNode;
38
- directives: import("graphql").DirectiveNode[];
39
- selectionSet: import("graphql").SelectionSetNode;
40
- loc: Location | undefined;
41
- } | {
42
- kind: "FragmentDefinition";
43
- name: import("graphql").NameNode;
44
- typeCondition: import("graphql").NamedTypeNode;
45
- directives: import("graphql").DirectiveNode[];
46
- selectionSet: import("graphql").SelectionSetNode;
47
- loc: Location | undefined;
48
- variableDefinitions?: undefined;
49
- };
8
+ parseFragment(): FragmentSpreadNode | InlineFragmentNode;
9
+ parseFragmentDefinition(): FragmentDefinitionNode;
50
10
  }
package/index.js CHANGED
@@ -59,7 +59,7 @@ class FragmentArgumentCompatibleParser extends parser_js.Parser {
59
59
  this.expectKeyword('fragment');
60
60
  const name = this.parseFragmentName();
61
61
  if (this.peek(graphql.TokenKind.PAREN_L)) {
62
- return {
62
+ const fragmentDefinition = {
63
63
  kind: graphql.Kind.FRAGMENT_DEFINITION,
64
64
  name,
65
65
  variableDefinitions: this.parseVariableDefinitions(),
@@ -68,8 +68,9 @@ class FragmentArgumentCompatibleParser extends parser_js.Parser {
68
68
  selectionSet: this.parseSelectionSet(),
69
69
  loc: this.loc(start),
70
70
  };
71
+ return fragmentDefinition;
71
72
  }
72
- return {
73
+ const fragmentDefinition = {
73
74
  kind: graphql.Kind.FRAGMENT_DEFINITION,
74
75
  name,
75
76
  typeCondition: (this.expectKeyword('on'), this.parseNamedType()),
@@ -77,6 +78,7 @@ class FragmentArgumentCompatibleParser extends parser_js.Parser {
77
78
  selectionSet: this.parseSelectionSet(),
78
79
  loc: this.loc(start),
79
80
  };
81
+ return fragmentDefinition;
80
82
  }
81
83
  }
82
84
 
package/index.mjs CHANGED
@@ -55,7 +55,7 @@ class FragmentArgumentCompatibleParser extends Parser {
55
55
  this.expectKeyword('fragment');
56
56
  const name = this.parseFragmentName();
57
57
  if (this.peek(TokenKind.PAREN_L)) {
58
- return {
58
+ const fragmentDefinition = {
59
59
  kind: Kind.FRAGMENT_DEFINITION,
60
60
  name,
61
61
  variableDefinitions: this.parseVariableDefinitions(),
@@ -64,8 +64,9 @@ class FragmentArgumentCompatibleParser extends Parser {
64
64
  selectionSet: this.parseSelectionSet(),
65
65
  loc: this.loc(start),
66
66
  };
67
+ return fragmentDefinition;
67
68
  }
68
- return {
69
+ const fragmentDefinition = {
69
70
  kind: Kind.FRAGMENT_DEFINITION,
70
71
  name,
71
72
  typeCondition: (this.expectKeyword('on'), this.parseNamedType()),
@@ -73,6 +74,7 @@ class FragmentArgumentCompatibleParser extends Parser {
73
74
  selectionSet: this.parseSelectionSet(),
74
75
  loc: this.loc(start),
75
76
  };
77
+ return fragmentDefinition;
76
78
  }
77
79
  }
78
80
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@envelop/fragment-arguments",
3
- "version": "1.1.0-alpha-290f8ac.0",
3
+ "version": "1.1.0",
4
4
  "peerDependencies": {
5
5
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
6
6
  },
7
7
  "dependencies": {
8
- "@envelop/types": "1.4.0-alpha-290f8ac.0"
8
+ "@envelop/types": "1.4.0"
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",