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

Docs/improvement/extending schema 04082022 #1436

Merged
merged 10 commits into from
Aug 19, 2022

Conversation

PedroAntunesCosta
Copy link
Contributor

What's the purpose of this pull request?

Improving the guide on extending the FastStore API schema.

@PedroAntunesCosta PedroAntunesCosta requested a review from a team as a code owner August 11, 2022 22:11
@vercel
Copy link

vercel bot commented Aug 11, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
faststore ✅ Ready (Inspect) Visit Preview Aug 19, 2022 at 8:38PM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 11, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b06d8b1:

Sandbox Source
Store UI Typescript Configuration

Copy link
Member

@victorhmp victorhmp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!! 🎉 🎉 🎉

@victorhmp victorhmp added the documentation Improvements or additions to documentation label Aug 12, 2022
Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job! 👏

I think there is a final step missing, though:
pass the finalSchema to the getEnvelop method, like here. What do you think?

…tore-api.md

Co-authored-by: Eduardo Formiga <eduardo.formiga@gmail.com>
@PedroAntunesCosta
Copy link
Contributor Author

Thanks for the review, @eduardoformiga!

I left that part out because of some reasons:

  • The getEnvelop part is not exclusive for extending, projects need that to use the API.
  • There are alternatives to envelope, which work differently.
  • In the last example, I directed the user to change the name of the old schema instead of changing the final one.

However, I appreciate your point and think this guide would be better and cause less confusion if I add a section about that part of the code.

To do that, I would like to find a way to talk about that step in a generic way, even if the code example is based in the starters, which use envelope. Could I say that in this step we are creating a server? How would you put this if you were talking about what the role of envelope or apollo is?

@eduardoformiga
Copy link
Member

eduardoformiga commented Aug 15, 2022

Thanks for the review, @eduardoformiga!

I left that part out because of some reasons:

  • The getEnvelop part is not exclusive for extending, projects need that to use the API.
  • There are alternatives to envelope, which work differently.
  • In the last example, I directed the user to change the name of the old schema instead of changing the final one.

However, I appreciate your point and think this guide would be better and cause less confusion if I add a section about that part of the code.

To do that, I would like to find a way to talk about that step in a generic way, even if the code example is based in the starters, which use envelope. Could I say that in this step we are creating a server? How would you put this if you were talking about what the role of envelope or apollo is?

Agree with all your points!
Not sure about creating a server because Envelop is more like a GraphQL plugin library. Maybe I'd put that in that step we are integrating with the GraphQL layer or enriching the GraphQL execution layer with new features (like extending the schema).

We can also go ahead, and add this afterward. So I'll approve this PR!

:::

GraphQL is a very versatile language. By using the exported `getSchema` function, you can not only extend the base schema but also redefine the whole resolvers implementation.
### Integrate with the GraphQL layer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@PedroAntunesCosta PedroAntunesCosta merged commit 8343068 into main Aug 19, 2022
@PedroAntunesCosta PedroAntunesCosta deleted the docs/improvement/extending-schema-04082022 branch August 19, 2022 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants