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

Document what non-directive extensions actually are #306

Closed
wheresrhys opened this issue Dec 7, 2020 · 2 comments
Closed

Document what non-directive extensions actually are #306

wheresrhys opened this issue Dec 7, 2020 · 2 comments
Labels

Comments

@wheresrhys
Copy link

It's a bit confusing at present.

  1. Extensions in the graphql-compose sense appears to have nothing to do with the extend operator in GraphQL. There is nothing in the GraphQL spec about extensions in the graphql-compose sense, adn nothing in your docs I've been able to find either.
  2. There are no examples of what extensions might be used for or what outputs are possible with them. I'm guessing they are mainly intended for annotating aspects of a schema with metadata, but this doesn't get carried through to SDL. It'd be good to document the limitations
  3. The tests & typedefs aren't much help either - they more or less just assert that the extensions APIs are self-consistent
nodkz added a commit that referenced this issue May 27, 2021
…ctives are rewritten from scratch.

relates #319
closes #306

BREAKING CHANGE: `directives` are no more available under `extensions.directives` property.  Now `directives` are stored under it's own property in TypeComposers.
@nodkz
Copy link
Member

nodkz commented May 27, 2021

Extensions is a property on type/field/arg definitions to pass private extra metadata.
It's used only on the server-side with the Code-First approach, mostly for 3rd party middlewares & plugins.
Property extensions may contain private server metadata of any type (even functions)
and does not available via SDL.

If you need to provide public metadata to clients then use directives instead.
@see graphql/graphql-js#1527

@github-actions
Copy link

🎉 This issue has been resolved in version 9.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants