relay-compiler 10.1.2 → 10.1.3

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,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Relay v10.1.2
3
+ * Relay v10.1.3
4
4
  *
5
5
  * Copyright (c) Facebook, Inc. and its affiliates.
6
6
  *
@@ -212,7 +212,9 @@ function eachWithCombinedError(iterable, fn) {
212
212
 
213
213
  if (errors.length > 0) {
214
214
  if (errors.length === 1) {
215
- throw errors[0];
215
+ throw createUserError(String(errors[0]).split('\n').map(function (line, index) {
216
+ return index === 0 ? "- ".concat(line) : " ".concat(line);
217
+ }).join('\n'));
216
218
  }
217
219
 
218
220
  throw createUserError("Encountered ".concat(errors.length, " errors:\n") + errors.map(function (error) {
@@ -15094,7 +15096,8 @@ function visitLinkedField(field) {
15094
15096
  var schema = this.getContext().getSchema();
15095
15097
 
15096
15098
  if (edgeDirective) {
15097
- var fields = schema.getFields(transformedField.type);
15099
+ var fieldType = schema.isList(transformedField.type) ? transformedField.type.ofType : transformedField.type;
15100
+ var fields = schema.getFields(fieldType);
15098
15101
  var cursorFieldID;
15099
15102
  var nodeFieldID;
15100
15103
 
@@ -122,7 +122,12 @@ function eachWithCombinedError<T>(iterable: Iterable<T>, fn: T => void): void {
122
122
  }
123
123
  if (errors.length > 0) {
124
124
  if (errors.length === 1) {
125
- throw errors[0];
125
+ throw createUserError(
126
+ String(errors[0])
127
+ .split('\n')
128
+ .map((line, index) => (index === 0 ? `- ${line}` : ` ${line}`))
129
+ .join('\n'),
130
+ );
126
131
  }
127
132
  throw createUserError(
128
133
  `Encountered ${errors.length} errors:\n` +
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v10.1.2
2
+ * Relay v10.1.3
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
5
5
  *
@@ -105,7 +105,9 @@ function eachWithCombinedError(iterable, fn) {
105
105
 
106
106
  if (errors.length > 0) {
107
107
  if (errors.length === 1) {
108
- throw errors[0];
108
+ throw createUserError(String(errors[0]).split('\n').map(function (line, index) {
109
+ return index === 0 ? "- ".concat(line) : " ".concat(line);
110
+ }).join('\n'));
109
111
  }
110
112
 
111
113
  throw createUserError("Encountered ".concat(errors.length, " errors:\n") + errors.map(function (error) {
@@ -137,7 +137,8 @@ function visitLinkedField(field) {
137
137
  var schema = this.getContext().getSchema();
138
138
 
139
139
  if (edgeDirective) {
140
- var fields = schema.getFields(transformedField.type);
140
+ var fieldType = schema.isList(transformedField.type) ? transformedField.type.ofType : transformedField.type;
141
+ var fields = schema.getFields(fieldType);
141
142
  var cursorFieldID;
142
143
  var nodeFieldID;
143
144
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relay-compiler",
3
3
  "description": "A compiler tool for building GraphQL-driven applications.",
4
- "version": "10.1.2",
4
+ "version": "10.1.3",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
@@ -28,7 +28,7 @@
28
28
  "glob": "^7.1.1",
29
29
  "immutable": "~3.7.6",
30
30
  "nullthrows": "^1.1.1",
31
- "relay-runtime": "10.1.2",
31
+ "relay-runtime": "10.1.3",
32
32
  "signedsource": "^1.0.0",
33
33
  "yargs": "^15.3.1"
34
34
  },