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

GET HTTP queries are not idempotent #8461

Open
robsimmons opened this issue Mar 11, 2025 · 1 comment
Open

GET HTTP queries are not idempotent #8461

robsimmons opened this issue Mar 11, 2025 · 1 comment

Comments

@robsimmons
Copy link

robsimmons commented Mar 11, 2025

  • EdgeDB Version: 6.2
  • EdgeDB CLI Version: 7.0.3
  • OS Version: OSX

Steps to Reproduce:

  1. Create a local database with this schema
    using extension edgeql_http;
    
    module default {
      type Person {
        required name: str;
      };
    }
    
  2. Run the following command several times:
    curl -i -H "Content-Type: application/json" --request GET -u admin:<PASSWORD> "http://localhost:10700/branch/main/edgeql?query=insert%20Person%20%7Bname%3A%3D%20%22Fred%22%7D%3B%0A%0A%0A"
    
    which URLencodes the query
    insert Person {name:= "Fred"};
    

The expected behavior is that this query is rejected, like a GraphQL query containing a mutation would be rejected, given that it changes the database in a non-idempotent manner. The docs say "[Since HTTP is a stateless protocol, no DDL, transaction commands, can be executed using this endpoint.](https://docs.geldata.com/reference/clients/http)", but that applies equally to insertions, deletions, and updates.

The observed behavior is that each GET request adds a Person entity to the database.

@msullivan
Copy link
Member

I wonder if we actually disallow GraphQL mutations on GET, too.

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

No branches or pull requests

2 participants