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

fix: allow inserting files without requiring select permissions #84

Merged
merged 2 commits into from
May 27, 2022

Conversation

dbarrosop
Copy link
Member

Solves #69

if err != nil {
if err := client.Exec(
ctx,
`mutation InitializeFile($id: uuid) {insertFiles(objects: {id: $id}) {affected_rows}}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mutation work?

I would expect it to be:

mutation InitializeFile($id: uuid) {insertFiles(objects: [{id: $id}]) {affected_rows}}

Note the [] after objects:.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dbarrosop I guess the [] was not needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry, I thought I had answered and I forgot to press comment.

You don't need the [], otherwise tests would have blown up :P As a matter of fact, that specific query was built by hasura's explorer (by default they don't add the [], you have to do it "manually" in the editor).

@dbarrosop dbarrosop merged commit d17dc3e into main May 27, 2022
@dbarrosop dbarrosop deleted the dbarroso/insert branch May 27, 2022 09:37
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.

2 participants