Skip to main content

Use Studio Apollo Graphql

Use studio apollo graphql to work with hexabase Website

Integrate React

Installion

  • Login account in Website

  • Change uri to your uri hexabase: Apollo started

  • Go to organization "Your oganization"

     Example me: "hexabase"
  • Choice tag grahpql: "Your tag hexabase":

     Example me: "Deployed graphs - current default"

Note Type to choice test graphql:

  • Query: method GET

  • Mutation: method POST, PUT, PATH, DELETE

Create test graphql

Start with graphql

  • Choice Type to test [Query or Mutation].

  • Choice method by api want to test.

  • Choice some require about api test

    Header: Optional for api request.

    • Tick Authorization:

    • Field value: Bearer (your token)

    Arguments:

    • Note:

      • If there is a "!" at the end of data type. The variable is required.
        createWorkSpaceInput: CreateWorkSpaceInput!
      • If there is not a "!" at the end of data type. The variable optional exist or null
        createWorkSpaceInput: CreateWorkSpaceInput
    • Tick variables to request.

      • Example: argument createWorkSpace: String!
          # field input of create workspace
        {
        {
        "createWorkspaceCreateWorkSpaceInput": {
        "name": null
        }
        }
        }
    • Fill value of variables with data type.

      • Example: Fill value of argument: createWorkSpace: String!

          # field input of create workspace
        {
        {
        "createWorkspaceCreateWorkSpaceInput": {
        "name": "value"
        }
        }
        }

    Field: Is response of api

    • Tick response field what you want get.

      • Example: Fields w_id: String

        # after run api: result field response of api create workspace
        {
        "w_id": "615587ed10eb9d4937c5a419"
        }

    Full one api test:

    Perations:

      mutation Mutation($createWorkspaceCreateWorkSpaceInput: CreateWorkSpaceInput!) {
    createWorkspace(createWorkSpaceInput: $createWorkspaceCreateWorkSpaceInput) {
    w_id
    }
    }

    Variables

      {
    "createWorkspaceCreateWorkSpaceInput": {
    "name": "Name space"
    }
    }

    Headers

      Authorization: Bearer eyJhbGciOiJSUzx.x.x

    Response

      {
    "data": {
    "createWorkspace": {
    "w_id": "6156b3c644e839fa9668608f"
    }
    }
    }