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

Need docs for directive resolvers #530

Closed
stubailo opened this issue Dec 12, 2017 · 6 comments · Fixed by #628
Closed

Need docs for directive resolvers #530

stubailo opened this issue Dec 12, 2017 · 6 comments · Fixed by #628
Labels
docs Focuses on documentation changes

Comments

@stubailo
Copy link
Contributor

stubailo commented Dec 12, 2017

#518 by @giautm added a new feature that's shipping in 2.13.0, we need docs for it though! I propose a new page called "Schema directives" to document this stuff.

To run the docs:

  1. Go to /docs in the repo
  2. git submodule init && git submodule update
  3. npm install
  4. npm start

Adding a page can be done by:

  1. Adding a file in the docs/source directory
  2. Adding an entry with the filename to docs/_config.yml
  3. Don't forget to put the title/description like so: https://raw.githubusercontent.com/apollographql/graphql-tools/master/docs/source/mocking.md
@stubailo stubailo added the docs Focuses on documentation changes label Dec 12, 2017
@vladshcherbin
Copy link
Contributor

This one can be also solved with directives and is a good example of this great feature.

@stubailo
Copy link
Contributor Author

Yeah it can definitely be a good approach to authorization!

@stubailo
Copy link
Contributor Author

@giautm neat!! want to send that as a PR? If not I'll get around to copy-pasting it next week

@DavidHe1127
Copy link

@giautm Thanks for your example code. There is a typo in your code.

Wrong

attachDirectiveResolvers(
  schema,
  directiveResolvers,
});

Should be

attachDirectiveResolvers(schema, directiveResolvers);

@Altiano
Copy link

Altiano commented Feb 9, 2018

Can directive has parameters?
If so, please give me code example

@giautm giautm mentioned this issue Feb 12, 2018
@giautm
Copy link
Contributor

giautm commented Feb 12, 2018

@Altiano: I opened a PR for the document. Please check it, and you can check tests for more examples.

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

Successfully merging a pull request may close this issue.

5 participants