Skip to content

Commit

Permalink
fix: graphql field type limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
utyfua committed May 10, 2023
1 parent d92e680 commit e52c30d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typeorm-hasura",
"version": "0.0.12",
"version": "0.0.13",
"description": "",
"keywords": [
"hasura",
Expand Down
8 changes: 1 addition & 7 deletions src/mappers/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,11 @@ export function getGraphQLDefinitions(document: DocumentNode): GraphQlMetadataFo
if (type !== "query" as const && type !== "mutation" as const)
throw new Error(`Invalid type ${type} for field ${field.name.value}`);

let output_type: string;
if (field.type.kind === "NamedType") {
output_type = field.type.name.value;
} else
throw new Error(`Invalid type ${field.type.kind} for field ${field.name.value}`);

result.baseActions.push({
name: field.name.value,
definition: {
type,
output_type,
output_type: mapType(field.type),
arguments: field.arguments?.map(mapField) || [],
}
})
Expand Down

0 comments on commit e52c30d

Please sign in to comment.