Skip to content

Commit 7b3811d

Browse files
committed
Fix wrong name in IPCPatent scalar configuration
1 parent 56bb0ae commit 7b3811d

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.changeset/dirty-geckos-crash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'graphql-scalars': patch
3+
---
4+
5+
Fix wrong scalar name in the scalar configuration

src/scalars/patent/IPCPatent.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GraphQLScalarTypeConfig, ASTNode, Kind, GraphQLScalarType } from 'graphql';
1+
import { ASTNode, GraphQLScalarType, GraphQLScalarTypeConfig, Kind } from 'graphql';
22
import { createGraphQLError } from '../../error.js';
33

44
/* 1. [A-H] represents the Section Level of the Classification
@@ -24,7 +24,7 @@ const validate = (value: any, ast?: ASTNode) => {
2424
const specifiedByURL = 'https://www.wipo.int/classifications/ipc/en/';
2525

2626
export const GraphQLIPCPatentConfig = {
27-
name: 'IPCPatentClassification',
27+
name: 'IPCPatent',
2828

2929
description: `A field whose value is an IPC Class Symbol within the International Patent Classification System: https://www.wipo.int/classifications/ipc/en/`,
3030

@@ -34,9 +34,12 @@ export const GraphQLIPCPatentConfig = {
3434

3535
parseLiteral(ast) {
3636
if (ast.kind !== Kind.STRING) {
37-
throw createGraphQLError(`Can only validate strings as an IPC Class Symbol but got a: ${ast.kind}`, {
38-
nodes: ast,
39-
});
37+
throw createGraphQLError(
38+
`Can only validate strings as an IPC Class Symbol but got a: ${ast.kind}`,
39+
{
40+
nodes: ast,
41+
},
42+
);
4043
}
4144

4245
return validate(ast.value, ast);
@@ -54,4 +57,6 @@ export const GraphQLIPCPatentConfig = {
5457
},
5558
} as GraphQLScalarTypeConfig<string, string>;
5659

57-
export const GraphQLIPCPatent: GraphQLScalarType = /*#__PURE__*/ new GraphQLScalarType(GraphQLIPCPatentConfig);
60+
export const GraphQLIPCPatent: GraphQLScalarType = /*#__PURE__*/ new GraphQLScalarType(
61+
GraphQLIPCPatentConfig,
62+
);

0 commit comments

Comments
 (0)