graphql / graphql/graphiql

[graphql-language-service-interface] add suggestions to spread fragments on Field

Open
#880 11 comments 3 reactions 0 assignees View on GitHub
graphql-language-service
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

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:
![Screenshot 2019-05-26 at 15 30 07](https://user-images.githubusercontent.com/419821/58382524-746e8700-7fcb-11e9-85a8-5e150965fa92.png)

Another suggestion from me would be to consider adding inline fragments to union types as well:
![Screenshot 2019-05-26 at 15 30 16](https://user-images.githubusercontent.com/419821/58382531-a1229e80-7fcb-11e9-9bc6-ea4f9c777b4a.png)
(unions and inline fragments are quite common pain points for [Gatsby](https://github.com/gatsbyjs/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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.