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

Flow support - spread operator #2550

Closed
wants to merge 2 commits into from
Closed

Flow support - spread operator #2550

wants to merge 2 commits into from

Conversation

matikrk
Copy link

@matikrk matikrk commented Sep 13, 2019

Hi,
I started work on better flow support. Right now it generates code using spread operator, it was mentioned it in #1844
It's iteration over https://github.com/matikrk/graphql-code-generator/pull/1

Right now working will all plugins.
Extending needed methods inside flow specific classes.


It's still WIP, I have an idea to change 2 things here. But this code right now should pass all tests


// return interfaces.join(' & ') + (allFields.length ? ' & ' : '');

return '{' + '...' + interfaces.join(', ...') + (allFields.length ? ', ...' : '}');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think to change it in a base behind isFlow flag. Will be less changes

} else if (result.length === 1) {
return result[0];
} else {
return `{\n ...` + result.join(`,\n ...`) + `\n}`;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think to change it in a base behind isFlow flag. Will be less changes

@matikrk matikrk closed this Sep 13, 2019
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.

1 participant