Getting Started

How to install and use Mimic

Desktop

Mimic is released as a Desktop application, CLI(headless) tool and a set of NPM libraries.

  1. At first Download or Other Platforms if you haven’t already.

  2. Download an example graphQL schema tweets.graphql:

    type User {
      id: ID!
      first_name: String
      last_name: String
      full_name: String
    }
    
    type Notification {
      id: ID!
    }
    
    type Meta {
      id: ID!
    }
    
    type Tweet {
      id: ID!
      title: String
      Author: User
    }
    
    type Query {
      Tweet(id: ID!): Tweet 
      Tweets(limit: Int, skip: Int, sort_field: String, sort_order: String): [Tweet]
      TweetsData: Meta
      User(id: ID!): User
      Notifications(limit: Int): [Notification]
      NotificationsMeta: Meta
    }
    


  3. Create a new service with downloaded schema:
    • Navigate in menu: File > New Service
    • Click on “GraphQL” option
    • Click “Choose File” button and select recently downloaded “tweets.graphql” file
    • Give your service a name (for example “Tweets”)
    • Assign your service a port (for example 8080)

    add service

  4. Enable your service and add response:
    • Navigate to service details page by click on your service name on the left panel
    • Enable your service by clicking on the service toggle on the left panel by your service name
    • Click “Add” button on the service details page
    • Choose “query” schema
    • Switch editor to a “TREE” mode by clicking on the toggle by the “Data” field
    • Left-click on any node to see all available options and set desired response values
    • Click on the “Save” button and Mimic will immediately apply changes to the server

    add response

  5. Now you can query Mimic with GraphiQL tool:

    GraphiQL

    Congratulations! You’ve completed Mimic Desktop tutorial.

CLI (Headless)

To install a CLI version, run:

npm install -g @creditkarma/mimic-cli

CLI version works with exported service definition:

  • Navigate in menu: File > Export Services…
  • Select services you would like to export
  • Click “Export” button
  • Choose location and filename for exported services (for example “exported.mimic”)

    export

Run CLI with services you just exported:

$ mimic exported.mimic

mimic cli