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

How apollo-server suggestions works? #2

Closed
nikitastupin opened this issue Oct 11, 2020 · 1 comment
Closed

How apollo-server suggestions works? #2

nikitastupin opened this issue Oct 11, 2020 · 1 comment

Comments

@nikitastupin
Copy link
Owner

Following document returns following suggestions:

mutation { setNameFor }
Cannot query field \"setNameFor\" on type \"Mutation\". Did you mean \"setNameForHome\", \"setNameForCamera\", or \"setNameForHomeSensor\"?

However similar document returns less suggestions:

mutation { setName }
Cannot query field \"setName\" on type \"Mutation\". Did you mean \"setNameForHome\"?

If we would know the algorithm apollo-server uses for suggestion generation we'd potentially speed up guessing of fields, arguments and so on.

@nikitastupin
Copy link
Owner Author

nikitastupin commented Oct 14, 2020

It looks like suggestions implemented in underlying graphql-js library. The actual algorithm implemented in suggestionList() function.

@nikitastupin nikitastupin transferred this issue from another repository Oct 23, 2020
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

No branches or pull requests

2 participants