Sealing variable through graphql environmentStageChanges mutation
Anonymous
HOBBYOP

2 hours ago

I'm getting a Invalid patch error when trying to seal a variable through the GraphQL api. These are the definition I'm trying to use:


"""

EnvironmentConfig is a custom scalar type that represents the serializedConfig for an environment.

JSON Schema: https://backboard.railway.com/schema/environment.schema.json

"""

scalar EnvironmentConfig

  """

  Sets the staged patch for a single environment.

  """

  environmentStageChanges(

    environmentId: String!

    input: EnvironmentConfig!

    """

    Merge the input patch into the existing staged patch.

    """

    merge: Boolean

  ): EnvironmentPatch!

This is the variables content. I tried using payload as JSON and as regular object:


{

"environmentId": "ENV_UUID",

"payload": "{\"services\": {\"SERVICE_UUID\":{\"variables\":{\"VAR_NAME\":{\"isSealed\":true}}}}}"

}

This also mimicks the request payload the web app does on the internal graphql api.

How to proceed ?

Solved$10 Bounty

1 Replies

Railway
BOT

2 hours ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway about 2 hours ago


Status changed to Solved Anonymous about 2 hours ago


Anonymous
HOBBYOP

2 hours ago

Actually, it works. The payload field must not be a JSON


{

    "environmentId": "ENV_UUID",

    "payload": {

      "services": {

        "SERVICE_UUID": {

          "variables": {

            "VAR_NAME": {

              "isSealed": true

            }

          }

        }

      }

    }

  }

Status changed to Awaiting Railway Response Railway about 2 hours ago


Status changed to Solved Anonymous about 2 hours ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...