We will describe here how to install the free development version of GraphQL Server for Maximo. It is the same as a production one, just limited to five concurrent users.

Prerequisites

  • Git
  • docker
  • docker-compose
  • Working maximo.ear file

Installation

First, clone the server template with git:

git clone https://bitbucket.org/maximoplusteam/graphql-server-template.git

Go to the graphql-server-template directory. Copy the maximo.ear file inside the folder. Make sure that the db.url in maximo.properties inside the ear file point to the IP of the network adapter, not to the localhost. You may optionally put the maximo.properties file inside the directory as well, it will override the one from the ear file. If you are using Windows, open the docker-compose.yml file, and put the full path of the schema directory in the source property.

You are ready now to create and start the server. Open your shell or command prompt in graphql-server-template directory and run:

docker-compose up -d

To verify the installation run:

docker-compose logs -f

Try it out

GrapqQL Server is built upon the Apollo GraphQL server, and comes with its GraphQL Playground. Open the browser and navigate to http://localhost:4001/graphql, and then enter the credentials of a Maximo user. If you click on the SCHEMA button, you can see there are already some types defined in the schema. GraphQL server reads all the schema definitions from all the files inside the schema directory, and automatically exposes the types and creates the resolvers.

GraphQL Playground

Now let's run our first query:

query {
  po(fromRow:0, numRows:2){
    ponum
    description
    id
  }
}

Where to go from here?

If you want to start learning how to write Maximo  types, queries and mutations in GraphQL SDL,  then immerse yourself in our manual. If you feel you would like to see how GraphQL works in action, read our next blog post: Simple React Native application with GraphQL for Maximo.