profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/puchm/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

puchm/babel-watch 0

Reload your babel-node app on JS source file changes. And do it fast.

puchm/graphql-code-generator 0

A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.

puchm/graphql-tools 0

:wrench: Build, mock, and stitch a GraphQL schema using the schema language

puchm/mercurius 0

Implement GraphQL servers and gateways with Fastify

puchm/opcua-client-gui 0

OPC-UA GUI Client

pull request commentdotansimha/graphql-code-generator

Add filter, fixes #6709

What's next for this now? Is there anything else I need to do? And is there a recommended way I can already use this before it gets merged? Normally I can simply do that by installing it from my forked repo but I'm not sure how that works with this big monorepo...

puchm

comment created time in 21 hours

pull request commentmercurius-js/mercurius

Fix #568

Should be fine now.

puchm

comment created time in 2 days

push eventpuchm/mercurius

puchm

commit sha c3bb2d8c2e2c9a7707d3c3177bc5a81dfed6d686

Use wss when https is used

view details

push time in 2 days

pull request commentdotansimha/graphql-code-generator

Add filter, fixes #6709

I added a unit test. What do you think? Is this the right way to test it? Also, is my solution to the issue even the right thing to do?

puchm

comment created time in 3 days

push eventpuchm/graphql-code-generator

puchm

commit sha 7ea6864fe775a556017df233cf15de446809094d

Add unit test

view details

push time in 3 days

pull request commentdotansimha/graphql-code-generator

Add filter, fixes #6709

Sure, will do that later today. What do you think is the reason why some of the tests are failing for me, even without my changes? Is it because I was using npm as a package manager?

puchm

comment created time in 3 days

push eventpuchm/graphql-code-generator

puchm

commit sha 932e7a04141b694c4097a8f459b785ceae397fc7

Add changeset

view details

push time in 3 days

PR opened dotansimha/graphql-code-generator

Add filter, fixes #6709

Description

I added a filter to remove fields that are not included (files where shouldInclude is false). I think the implementation should be find but I am not sure if this is the right way to solve #6709.

Related #6709 <!-- Don't use Fixes or Fixed to refer issues -->

Type of change

Please delete options that are not relevant.

  • [*] Bug fix (non-breaking change which fixes an issue)

Screenshots/Sandbox (if appropriate/relevant):

This sandbox demonstrates what the issue was and contains a reproduction: https://codesandbox.io/s/crazy-fast-rcgcb?file=/types.ts:3977-4172

How Has This Been Tested?

I ran npm test which failed on some tests. However, these are unrelated and also fail without any changes at the current state of the repo. This may be because I am using npm instead of the normal tools?

The fix works on the case in the reproduction repo.

Test Environment:

  • OS: Windows 10
  • npm 7.13.0
  • Node 16.2.0

Checklist:

  • [*] I have followed the CONTRIBUTING doc and the style guidelines of this project (I have not created a failing test though, maybe someone can tell me how to do that?)
  • [*] I have performed a self-review of my own code
  • [*] I have commented my code, particularly in hard-to-understand areas
  • [*] I have made corresponding changes to the documentation
  • [*] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [*] New and existing unit tests pass locally with my changes (As mentioned, some tests are failing without any changes, no additional failing tests with my changes though)
  • [ ] Any dependent changes have been merged and published in downstream modules

Further comments

As mentioned I think the code is fine but I am not sure if this is the right way to solve the problem in the first place.

+10 -0

0 comment

1 changed file

pr created time in 3 days

push eventpuchm/graphql-code-generator

puchm

commit sha e8c1795c7f5412df36b3ec2330978ecb8e4758e7

Add filter

view details

push time in 3 days

push eventpuchm/graphql-code-generator

puchm

commit sha c37fbca40c2e60e08d0c04558e050db36f52d146

Remove package-lock

view details

push time in 3 days

issue commentdotansimha/graphql-code-generator

Non-existing enum types are referenced in ResolversParentTypes when mappers are used

I added a filter function that checks if the fields are included when the "Omit" thing is applied. I honestly don't really understand what the "Omit" thing is about but this fixes my issue. It's right here.

Should I open a pull request or is this not the right way to solve it?

puchm

comment created time in 3 days

push eventpuchm/graphql-code-generator

puchm

commit sha 5a7a299d3149e8c6468aa1ab90066995f7b18489

Add filtering for types that are not included

view details

push time in 3 days

fork puchm/graphql-code-generator

A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.

https://graphql-code-generator.com

fork in 3 days

issue openeddotansimha/graphql-code-generator

Non-existing enum types are referenced in ResolversParentTypes when mappers are used

Describe the bug <!-- A clear and concise description of what the bug is. --> Sometimes it can happen with the typescript-resolvers plugin that some fields in ResolversParentTypes contain references to other fields in ResolversParentTypes that don't exist. This only happens with enums that are mapped using the "mappers" functionality. E.g. look at this from the reproduction sandbox:

export type ResolversParentTypes = {
  Query: {};
  User: Omit<User, 'gender'> & { gender?: Maybe<ResolversParentTypes['Gender']> };
  Boolean: Scalars['Boolean'];
  String: Scalars['String'];
};

ResolversParentTypes['Gender'] doesn't exist.

Note that this only happens when mappers are used.

To Reproduce Repro sandbox: https://codesandbox.io/s/crazy-fast-rcgcb?file=/types.ts:3977-4172

<!-- ############# ############# 🛑 STOP! 🛑 STOP! 🛑 STOP! 🛑 STOP! 🛑 STOP! 🛑 STOP! 🛑 STOP! 🛑 STOP! 🛑 STOP! 🛑 STOP! 🛑 STOP!

PLEASE READ THE FOLLOWING: You can use this template to create a live sandbox of the issue: https://codesandbox.io/s/github/dotansimha/graphql-code-generator-issue-sandbox-template Make sure to fork this template, and run yarn generate in the terminal. Please make sure the Codegen and plugins version under package.json matches yours.

~~~~~~~~~ ISSUES WITH A LIVE REPRODUCTION WILL BE ANSWERED QUICKLY ~~~~~~~ ~~~~~~ ISSUES WITHOUT REPRODUCTION MIGHT GET CLOSED WITHOUT RESPONSE ~~~~~

############# ############# -->

  1. My GraphQL schema:
extend type Query {
    gender: User!
}

type User {
    gender: Gender
}

enum Gender {
    MALE
    FEMALE
}

  1. My GraphQL operations:
# None
  1. My codegen.yml config file:
schema: schema.graphql
generates:
  types.ts:
    plugins:
      - typescript
      - typescript-resolvers
    config:
      mappers:
        Gender: ./gender#OtherGender

Expected behavior <!-- A clear and concise description of what you expected to happen. --> I think there's two things that would make sense:

  1. Include enums in ResolversParentTypes
  2. The syntax where it omits a field from a type and then concatenates it together again (types.ts line 112 in sandbox) makes no sense in this scenario I think.

Environment:

  • OS:
  • @graphql-codegen/cli: "1.20.1",
  • @graphql-codegen/typescript: "1.21.0",
  • @graphql-codegen/typescript-resolvers: "^2.2.1",
  • NodeJS: 14.17.6

Additional context <!-- Add any other context about the problem here. -->

Once again: Note that this only happens when mappers are used on enums (as far as I know)

Also, it appears to me that this only happens when the types are nested. I tried adding a field to the Query type that returns a Gender directly and the result was fine.

created time in 4 days

push eventpuchm-repro/graphql-codegen-parent-resolver-types

puchm

commit sha e4d40d703547a5e9424b96352c1a95ba610efa18

Fix some oversights

view details

push time in 4 days

push eventpuchm-repro/graphql-codegen-parent-resolver-types

puchm

commit sha 1540235053e7ee54512367ef21662c57e7624faf

Initial commit

view details

push time in 4 days

create barnchpuchm-repro/graphql-codegen-parent-resolver-types

branch : main

created branch time in 4 days

created repositorypuchm-repro/graphql-codegen-parent-resolver-types

created time in 4 days

pull request commentmercurius-js/mercurius

Fix #568

Good point, fixed that.

puchm

comment created time in 4 days

push eventpuchm/mercurius

puchm

commit sha 841a3c04ad5a04c8694a06185bd4769c6cb13e44

Make protocol dynamic

view details

push time in 4 days

issue commentmercurius-js/mercurius

Subscription Protocols: graphql-transport-ws

Yes this is probably the same reason why I was failing there, I found a workaround though. I think it would be good to support the new protocol since the one we are using right now is deprecated.

steinroe

comment created time in 4 days

pull request commentmercurius-js/mercurius

Fix #568

It is working now using the legacyClient option. Request headers and query variables are also working fine.

puchm

comment created time in 4 days

push eventpuchm/mercurius

puchm

commit sha dddc5fa2bcdad333b6b41382d542646ffe881910

Working version of fetcher using legacy WS client

view details

push time in 4 days

pull request commentmercurius-js/mercurius

Fix #568

@mcollina I am testing against a simple mercurius server. <details> <summary>Server implementation</summary>

const Fastify = require('fastify');
const mercurius = require('./mercurius');

const app = Fastify();

const gql = String.raw

const schema = gql`
    type Query {
        me: String
    }

    type Subscription {
        commentAdded: Comment!
    }

    type Comment {
        text: String
    }

    type Mutation {
        addComment(text: String): Boolean!
    }
`

const resolvers = {
    Query: {
        me: () => 'Hello there.'
    },
    Mutation: {
        addComment: (_parent, { text }, { pubsub }) => {
            pubsub.publish({
                topic: 'COMMENT',
                payload: {
                    value: text
                }
            });

            return true;
        }
    },
    Subscription: {
        commentAdded: {
            subscribe: (_root, _args, { pubsub }) => pubsub.subscribe('COMMENT')
        }
    }
}

app.register(mercurius, {
    graphiql: true,
    resolvers: resolvers,
    schema: schema,
    subscription: {
        onConnect: () => {
            console.log("hiii")
        }
    }
})

app.listen(4001).then(() => console.log("HI there"))

</details>

I asked on the Apollo GraphQL discord and apparently this could be caused by the server using the legacy websockets protocol instead of graphql-ws.

puchm

comment created time in 4 days

issue commentmercurius-js/mercurius

GraphiQL fetcher uses HTTP for subscriptions

I have created a PR that tries to address this but I am stuck with the WebSocket closing with code 1002. Read the PR for further info. It's a draft for now - any ideas on how to fix that?

puchm

comment created time in 6 days

PR opened mercurius-js/mercurius

Fix #568

This is a draft.

I have tried using GraphiQL.createFetcher in order to create a fetcher that works properly for subscriptions.

However, the WebSocket is getting closed with code 1002 every time I try to open a subscription. This has already been reported in https://github.com/graphql/graphiql/issues/1800 but the issue is still the same after changing the GraphiQL version.

Any ideas?

+29 -18

0 comment

2 changed files

pr created time in 6 days

push eventpuchm/mercurius

puchm

commit sha c907dcaf20ae65c5da23d9b9f1bea7ed783b5437

Update GraphiQL version

view details

push time in 6 days

push eventpuchm/mercurius

puchm

commit sha 2c32886d5152ce5cab19cdffc1054fbafb125690

Modified fetcher

view details

push time in 6 days

push eventpuchm/mercurius

dependabot[bot]

commit sha 3c7dfcf64a75d8b34e01b1959a9dc54a4d5f3ef3

build(deps): bump fastify/github-action-merge-dependabot (#551) Bumps [fastify/github-action-merge-dependabot](https://github.com/fastify/github-action-merge-dependabot) from 2.2.0 to 2.3.0. - [Release notes](https://github.com/fastify/github-action-merge-dependabot/releases) - [Commits](https://github.com/fastify/github-action-merge-dependabot/compare/v2.2.0...v2.3.0) --- updated-dependencies: - dependency-name: fastify/github-action-merge-dependabot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

dependabot[bot]

commit sha d8050a84268c8b147d5e23b14224913d90f516f3

build(deps): bump fastify/github-action-merge-dependabot (#552) Bumps [fastify/github-action-merge-dependabot](https://github.com/fastify/github-action-merge-dependabot) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/fastify/github-action-merge-dependabot/releases) - [Commits](https://github.com/fastify/github-action-merge-dependabot/compare/v2.3.0...v2.4.0) --- updated-dependencies: - dependency-name: fastify/github-action-merge-dependabot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

dependabot[bot]

commit sha ecce6ddb20811487b7d66f2a6394c81fda0099cb

build(deps-dev): bump @graphql-tools/merge from 7.0.0 to 8.0.0 (#555) Bumps [@graphql-tools/merge](https://github.com/ardatan/graphql-tools/tree/HEAD/packages/merge) from 7.0.0 to 8.0.0. - [Release notes](https://github.com/ardatan/graphql-tools/releases) - [Changelog](https://github.com/ardatan/graphql-tools/blob/master/packages/merge/CHANGELOG.md) - [Commits](https://github.com/ardatan/graphql-tools/commits/@graphql-tools/merge@8.0.0/packages/merge) --- updated-dependencies: - dependency-name: "@graphql-tools/merge" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

Matteo Collina

commit sha 140f67116f6a60e12b61e6c9520da651b8bc8871

Fixed compatibility with ws@8.0.0 (#557) Closes #556

view details

Matteo Collina

commit sha 97ee1403de08f86b2596c68455b1ea75c4740d4b

Bumped v8.1.2

view details

Jonny Green

commit sha 699fce071839844146fbc77d09c5547140e9ae44

Fix duplicate custom directives in the gateway schema (#559)

view details

Matteo Collina

commit sha 3f937120dff6c2fd2797b734bf85090877efa7e1

Bumped v8.1.3

view details

dependabot[bot]

commit sha 18d25fa6ea6144fde519d3a85ee723fdcbab4101

build(deps): bump fastify-websocket from 3.2.2 to 4.0.0 (#561) Bumps [fastify-websocket](https://github.com/fastify/fastify-websocket) from 3.2.2 to 4.0.0. - [Release notes](https://github.com/fastify/fastify-websocket/releases) - [Commits](https://github.com/fastify/fastify-websocket/compare/v3.2.2...v4.0.0) --- updated-dependencies: - dependency-name: fastify-websocket dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

Alexander

commit sha 57883ccf9364d089c2ba16251d01123ee2b7c81d

Update open-telemetry.md (#563)

view details

Jiri Spac

commit sha 675769acf79a926f0bfdf6cc8e0abd7621798fb7

move graphql into peerDependencies (#564) * move graphql into peerDependencies When user installs graphql into their package.json, they get: ``` Ensure that there is only one instance of "graphql" in the node_modules directory. If different versions of "graphql" are the dependencies of other relied on modules, use "resolutions" to ensure only one version is installed. https://yarnpkg.com/en/docs/selective-version-resolutions Duplicate "graphql" modules cannot be used at the same time since different versions may have different capabilities and behavior. The data from one version used in the function from another could produce confusing and spurious results. ``` * update install command

view details

Matteo Collina

commit sha 23ad27f17b7e4a7617823769ef133caed9e29c1b

Bumped v8.2.0

view details

Matteo Collina

commit sha 4e6b25bca0701c83efc5ec06fbf60175c0b149a6

Added graphql both as a peerDependency and as a dependency (#565)

view details

Matteo Collina

commit sha e0f672c4a3dc2054e9557d863183aa58e265f34b

Bumped v8.2.1

view details

puchm

commit sha 5cd6c5228cab93935305bdb71f424666a792a150

Merge branch 'mercurius-js:master' into master

view details

push time in 9 days

issue openedmercurius-js/mercurius

GraphiQL fetcher uses HTTP for subscriptions

I have been experimenting with subscriptions and the way mercurius currently uses GraphiQL is slightly wrong. The fetcher always uses the fetch API which should not be used for subscriptions which use WebSockets.

Apparently, there is a package (@graphiql/create-fetcher) which comes with a function that allows for an easy way to create a fetcher, there is some good documentation on this here: https://github.com/graphql/graphiql/blob/main/packages/graphiql-toolkit/docs/create-fetcher.md

Do you agree with me that the current way of doing it is wrong? All subscriptions just return null when requested via GraphiQL or even throw an error if the response is non-nullable.

I can maybe look into making a PR about this next week if we agree on using @graphiql/create-fetcher.

created time in 9 days