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

Update runnable schema in runtime when provider app changes version #420

Merged
merged 12 commits into from Jun 23, 2021

Conversation

gris
Copy link
Contributor

@gris gris commented Sep 15, 2020

What is the purpose of this pull request?

Update graphql runnable schema in runtime when a new version of a provider app is installed in the same workspace.

What problem is this solving?

It stops breaking the store when a new field is added and called by a store.

How should this be manually tested?

You can use this workspace that already has a modified graphql schema, and link a new version of search-graphql and add new fields.

This contribution depends on this one, which is deployed.

Screenshots or example usage

image

To test in other workspace:

  • Link the branch in the above PR of graphql-server
  • Do a yarn link on the graphql resolver of your choice (and yarn watch)
  • link your new version of the provider app and add fields

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

Copy link
Contributor

@klzns klzns left a comment

Choose a reason for hiding this comment

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

Tested in my own workspace without the code linked which triggered the error.

Linked all the code in my workspace, and rerun the query and it worked fine 👍

Steps:

  1. vtex link with https://github.com/vtex/graphql-server/pull/251
  2. Open a terminal with this code and run yarn, yarn build and yarn link
  3. Open a terminal with search-resolver@1.x and run yarn link @vtex/api inside the node folder, and then vtex link
  4. Open a terminal with search-graphql add a new field in the Product type and query it in the GraphQL IDE just like the example bellow:

https://breno--demostore.myvtex.com/_v/private/vtex.search-graphql@0.30.0/graphiql/v1?query=%7B%0A%20%20products(query%3A%22coffee%22)%7B%0A%20%20%20%20productId%0A%20%20%20%20productName%0A%20%20%20%20novo%0A%20%20%7D%0A%7D

Copy link
Contributor

@Jeymisson Jeymisson left a comment

Choose a reason for hiding this comment

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

LGTM would wait for @tlgimenes review

@gris gris requested a review from brunoabreu October 5, 2020 17:16
@gris gris merged commit 8538022 into master Jun 23, 2021
@gris gris deleted the feature/update-schema branch June 23, 2021 19:44
@hiagolcm hiagolcm mentioned this pull request Sep 8, 2021
4 tasks
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

Successfully merging this pull request may close these issues.

None yet

7 participants