You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running API generator using the --scalar-codecs flag, all generated GraphQL files are simply:
moduleMainexposing (..)
(entirety of file)
This fairly obviously causes the VerifyScalarCodecs compilation check to fail. Removing the --scalar-codecs flag makes things generate and work as expected.
Things that helped:
I am able to generate the API files when using the bin/elm-graphql built from source.
Adding fs-extra@8.0.1 to the dev dependencies in my project allows the npm packaged elm-graphql to generate as expected. (Hat tip to @nonpop on Elm Slack for that discovery)
Things that did not help:
Using the contents of the generated ScalarCodecs.elm file in place of my custom one
The text was updated successfully, but these errors were encountered:
mattdb
changed the title
API Generation failure with CustomScalars and npm package 3.5.0-3.6.0
API Generation failure with custom scalars and npm package 3.5.0-3.6.0
May 24, 2019
And even better... I found the reason that the CI was not catching this issue so this kind of thing should be prevented in the future!
So the problem is that I was running the end to end test script from my npm scripts (npm run approve). So it was pulling in those local NPM dependencies.
So what I've done now is:
I call the end to end testing script directly as a bash script, not through npm (./bin/approve)
In the end to end testing script, I'm using npm link to actually build the elm-graphql binary locally and package it up (instead of directly invoking ../bin/elm-graphql, the bundled JS code). That should make the test more realistic.
So this ended up leading to a more robust CI, which I'm very happy about. I can't stand one-off fixes that I have to become superstitious about maybe breaking again in the future.
Thanks again to all of you for helping me identify and understand the issue!!!
When running API generator using the
--scalar-codecs
flag, all generated GraphQL files are simply:(entirety of file)
This fairly obviously causes the VerifyScalarCodecs compilation check to fail. Removing the
--scalar-codecs
flag makes things generate and work as expected.Things that helped:
bin/elm-graphql
built from source.elm-graphql
to generate as expected. (Hat tip to @nonpop on Elm Slack for that discovery)Things that did not help:
ScalarCodecs.elm
file in place of my custom oneThe text was updated successfully, but these errors were encountered: