graphql-codegen-reason icon indicating copy to clipboard operation
graphql-codegen-reason copied to clipboard

`Node` type

Open idkjs opened this issue 6 years ago • 1 comments

I tried running your project against the swapi-graphql schema. The schema and output can be see here: https://github.com/idkjs/graphql-codegen-reason/tree/master/tester. Side note: Only way I could get this to run is to run it on your master repo and switching out the schema. Installing the codegen per the instructions did not work for me. Probably just to thick in the head to understand your readme, but none the less.

Is this a bug or not an intended use case? Thanks for the feedback.

Running the codegen produces the following error:

>>>> Finish compiling(exit: 1)
>>>> Start compiling
[1/1] Building tester/generated/GraphQLTypes-GqlToReasonTester.cmj

  We've found a bug for you!
  /Users/prisc_000/working/graphql-codegen-reason-fork/tester/generated/GraphQLTypes.re 664:29-32

  662 │   let vehicle: field(t, option(vehicle)) =
  663 │     getNullableField(~fieldName="vehicle", ~typename);
  664 │   let node: field(t, option(node)) =
  665 │     getNullableField(~fieldName="node", ~typename);
  666 │ };

  This type constructor's parameter, `node`, can't be found. Is it a typo?

>>>> Finish compiling(exit: 1)

idkjs avatar Oct 16 '19 15:10 idkjs

Apparently, if you change

let node: field(t, option(node))

to

let node: field(t, option('node))

It compiles. I cant test it yet because I cant get the graphql-codegen-reason-react-apollo or reason-client to build. I have never used TSDX but maybe you need a postinstall script in the packages. Right now, after installing the packages, the packages are in node_modules but they have not been built so there is no dist folder that graphql-codegen is looking for.

I tried building them and go the dist folder but that just got me to the next error.

.
                  Reason:
                    Cannot find module './graphql-codegen-r
eason-client.cjs.development.js'
    Require stack:

idkjs avatar Oct 16 '19 16:10 idkjs