@graphql-eslint/eslint-plugin 3.0.1-alpha-8123ea2.0 → 3.0.1-alpha-86a9e78.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/index.js +7 -7
- package/index.mjs +7 -7
- package/package.json +1 -1
package/index.js
CHANGED
@@ -2041,11 +2041,13 @@ const rule$b = {
|
|
2041
2041
|
}
|
2042
2042
|
const selector = [
|
2043
2043
|
`:matches(${graphql.Kind.OBJECT_TYPE_DEFINITION}, ${graphql.Kind.OBJECT_TYPE_EXTENSION})[name.value=${mutationType.name}]`,
|
2044
|
-
|
2044
|
+
'>',
|
2045
|
+
graphql.Kind.FIELD_DEFINITION,
|
2046
|
+
graphql.Kind.NAMED_TYPE,
|
2045
2047
|
].join(' ');
|
2046
2048
|
return {
|
2047
2049
|
[selector](node) {
|
2048
|
-
const typeName = node.value;
|
2050
|
+
const typeName = node.name.value;
|
2049
2051
|
const graphQLType = schema.getType(typeName);
|
2050
2052
|
if (graphql.isScalarType(graphQLType)) {
|
2051
2053
|
context.report({
|
@@ -2695,13 +2697,11 @@ const rule$i = {
|
|
2695
2697
|
}
|
2696
2698
|
const selector = [
|
2697
2699
|
`:matches(${graphql.Kind.OBJECT_TYPE_DEFINITION}, ${graphql.Kind.OBJECT_TYPE_EXTENSION})[name.value=${mutationType.name}]`,
|
2698
|
-
|
2699
|
-
graphql.Kind.FIELD_DEFINITION,
|
2700
|
-
graphql.Kind.NAMED_TYPE,
|
2700
|
+
`> ${graphql.Kind.FIELD_DEFINITION} > .gqlType ${graphql.Kind.NAME}`,
|
2701
2701
|
].join(' ');
|
2702
2702
|
return {
|
2703
2703
|
[selector](node) {
|
2704
|
-
const typeName = node.
|
2704
|
+
const typeName = node.value;
|
2705
2705
|
const graphQLType = schema.getType(typeName);
|
2706
2706
|
if (graphql.isObjectType(graphQLType)) {
|
2707
2707
|
const { fields } = graphQLType.astNode;
|
@@ -2709,7 +2709,7 @@ const rule$i = {
|
|
2709
2709
|
if (!hasQueryType) {
|
2710
2710
|
context.report({
|
2711
2711
|
loc: getLocation(node.loc, typeName),
|
2712
|
-
message: `Mutation result type "${graphQLType.name}" must contain field of type "${queryType.name}"
|
2712
|
+
message: `Mutation result type "${graphQLType.name}" must contain field of type "${queryType.name}"`,
|
2713
2713
|
});
|
2714
2714
|
}
|
2715
2715
|
}
|
package/index.mjs
CHANGED
@@ -2035,11 +2035,13 @@ const rule$b = {
|
|
2035
2035
|
}
|
2036
2036
|
const selector = [
|
2037
2037
|
`:matches(${Kind.OBJECT_TYPE_DEFINITION}, ${Kind.OBJECT_TYPE_EXTENSION})[name.value=${mutationType.name}]`,
|
2038
|
-
|
2038
|
+
'>',
|
2039
|
+
Kind.FIELD_DEFINITION,
|
2040
|
+
Kind.NAMED_TYPE,
|
2039
2041
|
].join(' ');
|
2040
2042
|
return {
|
2041
2043
|
[selector](node) {
|
2042
|
-
const typeName = node.value;
|
2044
|
+
const typeName = node.name.value;
|
2043
2045
|
const graphQLType = schema.getType(typeName);
|
2044
2046
|
if (isScalarType(graphQLType)) {
|
2045
2047
|
context.report({
|
@@ -2689,13 +2691,11 @@ const rule$i = {
|
|
2689
2691
|
}
|
2690
2692
|
const selector = [
|
2691
2693
|
`:matches(${Kind.OBJECT_TYPE_DEFINITION}, ${Kind.OBJECT_TYPE_EXTENSION})[name.value=${mutationType.name}]`,
|
2692
|
-
|
2693
|
-
Kind.FIELD_DEFINITION,
|
2694
|
-
Kind.NAMED_TYPE,
|
2694
|
+
`> ${Kind.FIELD_DEFINITION} > .gqlType ${Kind.NAME}`,
|
2695
2695
|
].join(' ');
|
2696
2696
|
return {
|
2697
2697
|
[selector](node) {
|
2698
|
-
const typeName = node.
|
2698
|
+
const typeName = node.value;
|
2699
2699
|
const graphQLType = schema.getType(typeName);
|
2700
2700
|
if (isObjectType$1(graphQLType)) {
|
2701
2701
|
const { fields } = graphQLType.astNode;
|
@@ -2703,7 +2703,7 @@ const rule$i = {
|
|
2703
2703
|
if (!hasQueryType) {
|
2704
2704
|
context.report({
|
2705
2705
|
loc: getLocation(node.loc, typeName),
|
2706
|
-
message: `Mutation result type "${graphQLType.name}" must contain field of type "${queryType.name}"
|
2706
|
+
message: `Mutation result type "${graphQLType.name}" must contain field of type "${queryType.name}"`,
|
2707
2707
|
});
|
2708
2708
|
}
|
2709
2709
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@graphql-eslint/eslint-plugin",
|
3
|
-
"version": "3.0.1-alpha-
|
3
|
+
"version": "3.0.1-alpha-86a9e78.0",
|
4
4
|
"sideEffects": false,
|
5
5
|
"peerDependencies": {
|
6
6
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|