pipefy

Cliente Digital - gql files

Gql files ( .gql is an acronym for graphql files) are files with a query or a mutation that you use to interact with the Pipefy GraphQL. You can learn more about pipefy graphql on its documentation and pratice/test here.

This package offer gql’s you may know at graphql directory. You dont need to know this files to use the package but read them are a good way to learn more about pipefy graphql api and also improve your know to implements your own gql’s.

Let’s check how this package use gql’s. For instance, take a look into the the pipe/all.gql used to retrieve all Pipes from a specific organization:

{
  organization(id:_R.ORGID_){
    pipes{
      id
    }
  }
}

This file contain a graphql query and use only one variable ORGID to receive the organization id you gonna query.

The syntax are _R.ORGID_. All variables are defined in uppercase, between underscore _[VARIABLE]_ and the prefix R is used to set a variable as Required. If you try to run this script without set ORGID you receive an Exception.

You dont’t use this gql directly. They are used by the Pipefy\Graphql implementations. At this case Pipefy\Graphql\Pipe\All.

Ok, let’s check another example. The gql file label/create:

mutation{
createLabel(
  input: {
  color: "_COLOR_"
  name: "_NAME_"
  pipe_id: _PIPEID_
  table_id: _TABLEID_
  }
) {
  clientMutationId
}
}

from this gql we can understand:

variables are:

But now let’s talk about the type of variables. It can be only with quotation mark or without quotation mark. By without quotation mark you have boolean as the field done at mutation updateCard, Int like the field current_phase_age at updateCard or any other type you need set without Quotation mark and be quoted are String and Datetime (check pipefy graphql objects documentation).

Field Types