Skip to content

Commit

Permalink
fix: VariableJSONSchema for custom scalars (#2986)
Browse files Browse the repository at this point in the history
  • Loading branch information
bboure committed Jan 22, 2023
1 parent 5f276c4 commit e68cb8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-crews-clean.md
@@ -0,0 +1,5 @@
---
'graphql-language-service': patch
---

Fix JSON schema for custom scalars validation
Expand Up @@ -144,9 +144,8 @@ function getJSONSchemaFromGraphQLType(
definition.enum = type.getValues().map(val => val.name);
}

if (isScalarType(type)) {
// I think this makes sense for custom scalars?
definition.type = scalarTypesMap[type.name] ?? 'any';
if (isScalarType(type) && scalarTypesMap[type.name]) {
definition.type = scalarTypesMap[type.name];
}
if (isListType(type)) {
definition.type = 'array';
Expand Down

0 comments on commit e68cb8b

Please sign in to comment.