eddeee888 / graphql-code-generator-plugins

List of GraphQL Code Generator plugins that complements the official plugins.
MIT License
50 stars 12 forks source link

feat(imports): Add emitLegacyCommonJSImports setting #121

Closed JustusFluegel closed 1 year ago

JustusFluegel commented 1 year ago

Closes #65

Sorry that this took so long, had a lot popping up and then kinda forgot I created this issue.

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 2940182a11b414fa622466806a0fa1fb1424686c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------------------------------- | ----- | | @eddeee888/gcg-typescript-resolver-files | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

eddeee888 commented 1 year ago

Hi @JustusFluegel , thank you for creating the PR! It's looking good. I left a few minor comments.

Here's a few extra things to do to make it ready to be merged:

JustusFluegel commented 1 year ago

I think that looks good

╭────┬─────────────────────────────────────────────────╮
│  # │                    capture2                     │
├────┼─────────────────────────────────────────────────┤
│  0 │ ./../../types.generated.js                      │
│  1 │ ./../../types.generated.js                      │
│  2 │ graphql                                         │
│  3 │ ./types.generated.js                            │
│  4 │ ./topic/resolvers/Mutation/topicCreate.js       │
│  5 │ ./topic/resolvers/Mutation/topicEdit.js         │
│  6 │ ./base/resolvers/PaginationResult.js            │
│  7 │ ./base/resolvers/PayloadError.js                │
│  8 │ ./user/resolvers/Profile.js                     │
│  9 │ ./user/resolvers/Query/me.js                    │
│ 10 │ ./topic/resolvers/Query/topicById.js            │
│ 11 │ ./topic/resolvers/Query/topicsCreatedByUser.js  │
│ 12 │ ./user/resolvers/Query/userByAccountName.js     │
│ 13 │ ./base/resolvers/SomeRandomScalar.js            │
│ 14 │ ./user/resolvers/Subscription/profileChanges.js │
│ 15 │ ./topic/resolvers/Topic.js                      │
│ 16 │ ./topic/resolvers/TopicByIdPayload.js           │
│ 17 │ ./topic/resolvers/TopicByIdResult.js            │
│ 18 │ ./topic/resolvers/TopicCreatePayload.js         │
│ 19 │ ./topic/resolvers/TopicCreateResult.js          │
│ 20 │ ./topic/resolvers/TopicEditPayload.js           │
│ 21 │ ./topic/resolvers/TopicEditResult.js            │
│ 22 │ ./topic/resolvers/TopicsCreatedByUserPayload.js │
│ 23 │ ./topic/resolvers/TopicsCreatedByUserResult.js  │
│ 24 │ ./user/resolvers/User.js                        │
│ 25 │ ./user/resolvers/UserPayload.js                 │
│ 26 │ ./user/resolvers/UserResult.js                  │
│ 27 │ graphql-scalars                                 │
│ 28 │ ./../../../types.generated.js                   │
│ 29 │ ./../../../types.generated.js                   │
│ 30 │ ./../../../types.generated.js                   │
│ 31 │ ./../../../types.generated.js                   │
│ 32 │ ./../../types.generated.js                      │
│ 33 │ ./../../types.generated.js                      │
│ 34 │ ./../../types.generated.js                      │
│ 35 │ ./../../types.generated.js                      │
│ 36 │ ./../../types.generated.js                      │
│ 37 │ ./../../types.generated.js                      │
│ 38 │ ./../../types.generated.js                      │
│ 39 │ ./../../types.generated.js                      │
│ 40 │ ./../../types.generated.js                      │
│ 41 │ graphql                                         │
│ 42 │ graphql                                         │
│ 43 │ ./topic/topic.mappers                           │
│ 44 │ ./../../types.generated.js                      │
│ 45 │ ./../../../types.generated.js                   │
│ 46 │ ./../../../types.generated.js                   │
│ 47 │ ./../../../types.generated.js                   │
│ 48 │ ./../../types.generated.js                      │
│ 49 │ ./../../types.generated.js                      │
│ 50 │ ./../../types.generated.js                      │
│ 51 │ graphql-tag                                     │
├────┼─────────────────────────────────────────────────┤
│  # │                    capture2                     │
╰────┴─────────────────────────────────────────────────╯
JustusFluegel commented 1 year ago

oops ./topic/topic.mappers isn't correct.

Searched for half an hour but couldn't find out where that is coming from. Any ideas?

eddeee888 commented 1 year ago

oops ./topic/topic.mappers isn't correct.

Searched for half an hour but couldn't find out where that is coming from. Any ideas?

Ah I see, mappers use the typescript-resolvers's mapper which can be set here

JustusFluegel commented 1 year ago

I think your link is incorrect, it just redirects me to my last message

eddeee888 commented 1 year ago

Oops, sorry 😅 . The correct link is here.

JustusFluegel commented 1 year ago

sorry, should be done, should be ready for review if you have the time @eddeee888

eddeee888 commented 1 year ago

Thanks @JustusFluegel! The implementation and e2e tests looks good!

There are some unit tests are failing here. Do you mind having a look?

I think we just need to add the flag in 🙂

You can run unit test by running this:

yarn nx test typescript-resolver-files
JustusFluegel commented 1 year ago

Hopefully this should be it. If that was it then thanks for your patience :) @eddeee888

eddeee888 commented 1 year ago

Great stuff! Thank you @JustusFluegel !