graphql-to-elm icon indicating copy to clipboard operation
graphql-to-elm copied to clipboard

Export the encoder and decoder of `Variables`

Open choonkeat opened this issue 5 years ago • 6 comments

Closes #12

  1. converts queryOperation.inputs: QueryObjectInput to QueryCompositeNonFragmentOutput
  2. then we can getCompositeDecoder for our queryOperation.inputs
  3. update generateExports and generateEncodersAndDecoders to include our new decoders

having a new decoder to work with QueryCompositeNonFragmentOutput | QueryObjectInput seem more correct but got hairy fast, so i went with the input conversion approach

choonkeat avatar Mar 13 '20 04:03 choonkeat

  running elm make
    ✖  Error: Command failed: elm make src/Main.elm --output=generated/index.html at step (/home/travis/build/harmboschloo/graphql-to-elm/tests/gen/test-browser/index.ts:44:23)
        'Error: Command failed: elm make src/Main.elm --output=generated/index.html'undefined

ah found out why this failed. i'll check that later

choonkeat avatar Mar 13 '20 04:03 choonkeat

  running elm make
    ✖  Error: Command failed: elm make src/Main.elm --output=generated/index.html at step (/home/travis/build/harmboschloo/graphql-to-elm/tests/gen/test-browser/index.ts:44:23)
        'Error: Command failed: elm make src/Main.elm --output=generated/index.html'undefined

ah found out why this failed. i'll check that later

if you run elm make src/Main.elm --output=generated/index.html in tests\gen\test-browser then you'll get the proper elm error. For the tests I disabled the elm output because it messed up the test output.

harmboschloo avatar Mar 13 '20 07:03 harmboschloo

avoided duplicating the encoders & decoders in 2a012b4 🙇

choonkeat avatar Mar 13 '20 09:03 choonkeat

Was this one finished? I kind of missed it 😅 .

harmboschloo avatar Apr 07 '20 06:04 harmboschloo

yes it's done! 👏 . i've been using my branch for a while

choonkeat avatar Apr 07 '20 06:04 choonkeat

Ah cool, so no need to rush then 😄 I'll see when I've got time to have a proper look.

having a new decoder to work with QueryCompositeNonFragmentOutput | QueryObjectInput seem more correct but got hairy fast, so i went with the input conversion approach

Yeah, I'd like to have another look at that.

Also I'm thinking of having this optional, and not have it enabled by default.

harmboschloo avatar Apr 14 '20 17:04 harmboschloo