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

Give a Cell's query an operation name #867

Merged
merged 2 commits into from
Jul 20, 2020
Merged

Conversation

peterp
Copy link
Contributor

@peterp peterp commented Jul 20, 2020

We now give generated cells an operation name:

export const QUERY = gql`
- query {
+ query TestQuery {
    userProfile {
     id
   }
  }
`

If the operation name is already taken we append _2, _3, _4 to the operation name.

@peterp peterp added this to the next release milestone Jul 20, 2020
@peterp peterp merged commit a556f2c into main Jul 20, 2020
@thedavidprice thedavidprice deleted the pp-name-operation-cell-generator branch July 20, 2020 21:22
@thedavidprice
Copy link
Contributor

@peterp For Storybook to work with Cells, is it required that the Cell query have an operation name?

@peterp
Copy link
Contributor Author

peterp commented Jul 21, 2020

Yes it's required. The generators now add a unique name and diagnostics will warn you if you don't have an operation name.

@peterp
Copy link
Contributor Author

peterp commented Jul 21, 2020

To be clear: This is required if you want to mock-requests for a Cell.

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

2 participants