Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate optional TypeScript fields when @include or @skip directive is used #1854

Closed

Conversation

mwilliamson
Copy link

This makes generated TypeScript fields optional if the @include directive is used. Fixes #888.

@apollo-cla
Copy link

@mwilliamson: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@mwilliamson mwilliamson force-pushed the typescript-optional-fields branch 2 times, most recently from 96ef2f9 to 24be1a4 Compare March 29, 2020 12:11
@OzzieOrca
Copy link

Does this support @skip as well?

@mwilliamson mwilliamson force-pushed the typescript-optional-fields branch from 24be1a4 to 2550fc1 Compare April 19, 2020 13:31
@mwilliamson
Copy link
Author

mwilliamson commented Apr 19, 2020

Does this support @skip as well?

Yes, @skip should also be supported. I've added a test case to cover this.

I've also signed the CLA.

@mwilliamson mwilliamson changed the title Generate optional TypeScript fields when @include directive is used Generate optional TypeScript fields when @include or @skip directive is used Apr 19, 2020
@MargaretKrutikova
Copy link

Very much appreciated, @mwilliamson! Just stumbled upon this issue at work, would be great to have it merged 🙂

@mwilliamson mwilliamson force-pushed the typescript-optional-fields branch from 8b2fe58 to 69fb99a Compare April 29, 2020 13:17
@hlehmann
Copy link

hlehmann commented Jul 9, 2020

any news on this ?

@chaffeqa
Copy link

If it helps, we are using this PR (via https://www.npmjs.com/package/patch-package) and its working great! Thx @mwilliamson

@dobesv
Copy link

dobesv commented Oct 8, 2020

I wonder if rebasing on latest master will clear up that build error.

@pelhage
Copy link

pelhage commented Dec 14, 2020

We ran into a bug caused by this issue. Would be nice to see this PR introduced!

@vidmantasa
Copy link

Any news on this?

@audriuss
Copy link

audriuss commented Mar 3, 2021

Please, merge the PR :) Please

@jaminhaber
Copy link

Can this be merged? It would come in very handy for me on a project

@samageloff
Copy link

Really looking forward to this!

@mwilliamson
Copy link
Author

I'm closing this since it seems like it's not going to be merged. Regardless, when I was still working on a codebase using GraphQL, we switched to GraphQL Code Generator.

@mwilliamson mwilliamson closed this Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codegen should take @include and @skip into account