Skip to content

Dont send ids to server #153

@casperstr

Description

@casperstr

Hi! 👋

Firstly, thanks for your work on this project! 🙂

The graphql-over-http spec does not specify any id beeing sent over the wire.
Therefore this might fail on certain servers.

diff --git a/node_modules/react-relay-network-modern/lib/RelayRequest.js b/node_modules/react-relay-network-modern/lib/RelayRequest.js
index e36ec20..5a52da1 100644
--- a/node_modules/react-relay-network-modern/lib/RelayRequest.js
+++ b/node_modules/react-relay-network-modern/lib/RelayRequest.js
@@ -62,7 +62,7 @@ var RelayRequest = /*#__PURE__*/function () {
         }
 
         var formData = new _FormData_();
-        formData.append('id', this.getID());
+        formData.append('operationName', this.getID());
         formData.append('query', this.getQueryString());
         formData.append('variables', JSON.stringify(this.getVariables()));
         Object.keys(uploadables).forEach(function (key) {
@@ -74,7 +74,7 @@ var RelayRequest = /*#__PURE__*/function () {
       }
 
       return JSON.stringify({
-        id: this.getID(),
+        operationName: this.getID(),
         query: this.getQueryString(),
         variables: this.getVariables()
       });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions