Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Fix TH generation for GraphQL input objects (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
serras authored Jan 8, 2021
1 parent b763d4f commit fcdb5d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
sudo apt-get install ruby-dev
sudo gem install bundler --force
sudo gem update --system
sudo bundle update --bundler
sudo bundle install --gemfile docs/Gemfile --path vendor/bundle
- name: Build microsite from last release
run: |
Expand Down
6 changes: 3 additions & 3 deletions graphql/src/Mu/GraphQL/Quasi.hs
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ typeToDec _ _ _ (GQL.InputObjectTypeDefinition _ name _ fields) =
ginputTypeToType (GQL.TypeNonNull (GQL.NonNullTypeNamed a)) =
[t| $(typeToPrimType a) |]
ginputTypeToType (GQL.TypeNonNull (GQL.NonNullTypeList a)) =
[t| 'ListRef $(ginputTypeToType a) |]
[t| 'TList $(ginputTypeToType a) |]
ginputTypeToType (GQL.TypeNamed a) =
[t| 'OptionalRef $(typeToPrimType a) |]
[t| 'TOption $(typeToPrimType a) |]
ginputTypeToType (GQL.TypeList a) =
[t| 'OptionalRef ('ListRef $(ginputTypeToType a)) |]
[t| 'TOption ('TList $(ginputTypeToType a)) |]
typeToPrimType :: GQL.Name -> Q Type
typeToPrimType "Int" = [t|'TPrimitive Integer|]
typeToPrimType "Float" = [t|'TPrimitive Double|]
Expand Down

0 comments on commit fcdb5d4

Please sign in to comment.