Open pieh opened 5 years ago
I'd like to see this 👍
Seconded 👍
That's awesome to hear, I'll try to find time to submit pull request this week
So right now getAutocompleteSuggestions
returns getSuggestionsForFieldNames
, but you'll want to create a function that combines the latter with getSuggestionsForFragmentSpread
. if you need help with the setup/linkages to test this end to end in graphiql
let me know
if you need help with the setup/linkages to test this end to end in
graphiql
let me know
Thanks for offer. I already have setup for it and part of code changes (probably will need to rename some functions to make more sense, refactor bit more), but I'm still exploring what (IMO) could make sense to add there.
My current changeset: https://github.com/graphql/graphql-language-service/compare/master...pieh:feat/suggest-fragment-spreads
Looks good! getFragmentsForType
, good approach. To note, I don't think any of us maintainers here in this thread have the keys to npm currently, but I think @lostplan might
@acao I do indeed have the keys to npm. (Am I the only one right now?! 😬We should definitely get that fixed)
@lostplan oh that's great news! GraphQL Foundation is chasing that down as we speak. Do you happen to have the keys for codemirror-graphql
as well?
I should clarify…
I am just a collaborator of graphql-language-service
; I don't hold the master key.
I don't think I have have permission to publish other repos.
@lostplan that's very helpful still! will you be at the meeting tomorrow? This repo will be one of the main topics of discussion. Yes, we are hoping to rename it to the GraphQL IDE working group.
@pieh feel free to open a PR in the new monorepo. changing the origin to this repo and rebasing might work, as the filename indexes for gls should be intact
Right now fragment spread suggestions are shown only when you start with
...
fragment spread operator.I'd like to propose adding fragment spread suggestion earlier (on
Field
,SelectionSet
etc), so we it's much easier for new GraphQL users to discover them.Basic idea is to have it look something like:
Another suggestion from me would be to consider adding inline fragments to union types as well: (unions and inline fragments are quite common pain points for Gatsby users that are new to GraphQL)
This would require just slight refactoring to reuse already existing code and I'm happy to submit pull request if this change would be welcome here.