Solved

Update select options - updatePhaseField error 30001

  • 11 August 2020
  • 3 replies
  • 520 views

Userlevel 2

Hi,

I’m wanting to update a select option in one of our pipes - I’m planning on using the GraphQL API so I can update the card data at the same time.

I’ve created a test pipe to prove that it works, but it doesn’t :(

 

The mutate query I am running (in https://app.pipefy.com/graphiql)

mutation {  updatePhaseField(      input: {        clientMutationId:"catsss"        id: "town"        label:"town"        allChildrenMustBeDoneToMoveParent:false        allChildrenMustBeDoneToFinishParent:false        canConnectExisting:false        canConnectMultiples:false        canCreateNewConnected: false        childMustExistToFinishParent:false        description:"cats dancing"        editable:false        help:"halp"        minimal_view:true        options: ["brisbane", "dubbo", "sydney"]        required:true        sync_with_card:true      }  ) {    clientMutationId    phase_field {      id    }  }}

When I run the query I get this error, but I’ve run many mutations with my user before, so am not sure what is going on

{  "data": {    "updatePhaseField": null  },  "errors": [    {      "code": 30001,      "locations": [        {          "column": 10,          "line": 1        }      ],      "message": "Permission denied",      "path": [        "updatePhaseField"      ],      "type": "PermissionDeniedError"    }  ]}

I’ve checked the field in the UI, and it is marked as editable.

Any help would be appreciated

icon

Best answer by vitor-oliveira9 18 August 2020, 15:42

View original

3 replies

Userlevel 4

Hello!

On the input you send “clientMutationId:"catsss"”, this mutation doesn’t use clientMutationId, so you need to erase it. 

Besides that the error message is "Permission denied" you either is not logged in on pipefy or you are not a pipe admin. 

If you are pipe admin just login on pipefy and refresh the graphiql page. 

 

Userlevel 4

Hey @m0ltz 

We update the query and now it is possible to use the uuid of the field to update it

To get the information:

{
pipe(id: 123456789) {
start_form_fields{
id
uuid
label
type
required
}
phases {
id
name
fields {
id
uuid
label
type
required
}
}
}
}

To do the update:

mutation{
updatePhaseField(input:{
id:"minha_demanda",
uuid:"bea86d18-355b-41f5-b4e3-e0926976dd45",
label:"Change It",
required:false
}){
phase_field{
label
required
}
}
}

 

This still does not work.

 

I’m logged in. I am the admin. I am still getting the same error:

mutation {

  updatePhaseField(input: {id: "supplier_id", label: "Supplier IDX", options: ["a", "b"]}) {

    clientMutationId

  }

}

 

{

  "data": {

    "updatePhaseField": null

  },

  "errors": [

    {

      "message": "Permission denied",

      "locations": [

        {

          "line": 18,

          "column": 1

        }

      ],

      "path": [

        "updatePhaseField"

      ],

      "code": 30001,

      "type": "PermissionDeniedError"

    }

  ]

}

Reply