Moped Documentation
  • Welcome 👋
  • User Guides
    • Getting started
    • Map a project
  • Product Management
    • User communication
    • User management
    • User analytics
    • Local testing
    • Release process
    • Patch release process
    • MUI X Pro License
    • Integrations
      • Dataset documentation
      • ArcGIS Online
      • eCapris
      • Power BI
    • Features
  • Dev Guides
    • DB Docs & Data dictionary
    • Database backup policy
    • Moped Read Replica
    • How-to's
      • How do I start the Hasura cluster locally?
      • How do I launch the Hasura Console?
      • How do I get a JWT token?
      • How to ping the GraphQL API
      • How to ping the REST API
      • How do I connect a database with Postgres GUIs?
      • How do I connect to the RDS instance?
      • How to load production data into a local instance
      • How do I update seed data?
    • Hasura
      • Hasura Roles
      • Hasura Migrations
        • Getting Started
        • Installing the Hasura CLI
        • Configuration Files
        • Hasura Migration Principles
        • The Migration file format
        • Development
        • Hasura Seed Data
        • Running the Hasura Cluster Locally (video)
        • Create a migration: Exercise 1 (video)
        • Create a migration: Exercise 2 (video)
        • Latest hasura-cluster features
    • User Management
    • Authentication
      • Authentication Architecture
      • DynamoDB & Cognito
      • Secrets Manager & Cognito
      • Hasura & Cognito
      • React & Cognito
      • Flask API & Cognito
      • Single Sign-On with CTM
    • Code organization
    • API
      • Configuration Files
      • Testing
      • User Management API
    • Maps and geospatial data
      • Access tokens and API keys
      • Map libraries
      • Map data
      • Map styles
      • Map layers and basemaps
      • React patterns
      • V1 Archive
        • Map libraries
        • Map data
        • Map custom hooks
        • Map styles
        • Map layers and basemaps
    • UI access control
    • Design system
      • Branding
      • Component styles
      • Text content
    • Activity Log
      • Architecture
      • GitHub Actions and Deployment of Updates
      • Hasura Event Logs and Truncate Cron Job
      • Authentication
  • See also
  • Get Moped support, report a bug, or request an enhancement
  • Data & Technology Services
  • Github repository
Powered by GitBook
On this page
  • Using GraphiQL (Hasura Console) Local Only
  • Sample Output
  • Hasura Console
  • Using Postman (Staging and Production)
  • Hasura Console with Staging or Production

Was this helpful?

  1. Dev Guides
  2. How-to's

How to ping the GraphQL API

Using GraphiQL (Hasura Console) Local Only

You will need to have the Hasura Cluster up and running, but once you do you only have to run these two commands:

$ ./hasura-cluster start
$ ./hasura-cluster console

There is a video on how to set up the Hasura cluster.

Sample Output

$ ./hasura-cluster start
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██░██░█░▄▄▀█░▄▄█░██░█░▄▄▀█░▄▄▀████░▄▄▀█░██░██░█░▄▄█▄░▄█░▄▄█░▄▄▀████░█▀▄██▄██▄░▄██
██░▄▄░█░▀▀░█▄▄▀█░██░█░▀▀▄█░▀▀░████░████░██░██░█▄▄▀██░██░▄▄█░▀▀▄████░▄▀███░▄██░███
██░██░█▄██▄█▄▄▄██▄▄▄█▄█▄▄█▄██▄████░▀▀▄█▄▄██▄▄▄█▄▄▄██▄██▄▄▄█▄█▄▄████░██░█▄▄▄██▄███
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Copyright © 1985 Data & Tech Services Corp.              Hasura Cluster:  start 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Creating network "moped-database_default" with the default driver
Creating volume "moped-database_moped-db-vol" with local driver
Creating moped-database_moped-pgsql_1 ... done
Creating moped-database_hasura_1      ... done
Checking the Hasura server is ready...
[λ] Hasura server ready!                    ✅?
--------------------------------------------------------------------
 ♻️  MIGRATIONS STARTED
--------------------------------------------------------------------
INFO migrations applied                           
INFO Metadata applied                             
INFO Seeds planted                                
--------------------------------------------------------------------
 Migrations Finished! 


--------------------------------------------------------------------
 ⛅️  Hasura Server Status
--------------------------------------------------------------------
 Status: ✅ OK
 Version: {"version":"v1.3.2"}
 You may run 'hasura console' now!
--------------------------------------------------------------------

$   ./hasura-cluster console
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██░██░█░▄▄▀█░▄▄█░██░█░▄▄▀█░▄▄▀████░▄▄▀█░██░██░█░▄▄█▄░▄█░▄▄█░▄▄▀████░█▀▄██▄██▄░▄██
██░▄▄░█░▀▀░█▄▄▀█░██░█░▀▀▄█░▀▀░████░████░██░██░█▄▄▀██░██░▄▄█░▀▀▄████░▄▀███░▄██░███
██░██░█▄██▄█▄▄▄██▄▄▄█▄█▄▄█▄██▄████░▀▀▄█▄▄██▄▄▄█▄▄▄██▄██▄▄▄█▄█▄▄████░██░█▄▄▄██▄███
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Copyright © 1985 Data & Tech Services Corp.              Hasura Cluster:  console 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Starting the Hasura Console... (press Ctrl+C to stop)
INFO console running at: http://localhost:9695/ 

Hasura Console

Using Postman (Staging and Production)

After that, you can now go to the Body section, and select GraphQL query type. On the left you will be able to provide a GraphQL query, and to the right you can provide any variables it needs:

Hasura Console with Staging or Production

This is not recommended, you should not be making changes directly to staging or production via the Hasura console. It is however possible, this requires you to change the config.yaml file in the moped-database folder to look a bit like this:

version: 2
endpoint: https://moped-graphql-staging.austinmobility.io
metadata_directory: metadata
admin_secret: <secret_here>
actions:
  kind: synchronous
  handler_webhook_baseurl: https://moped-graphql-staging.austinmobility.io

Please note that this is for documentation purposes only, you may take a look to staging or production, but under no circumstances you need to make changes directly to staging and production, this can cause the environments to be out of sync and break the migrations system, you would be in the hook for a serious headache and the users would be unable to use moped.

PreviousHow do I get a JWT token?NextHow to ping the REST API

Last updated 4 years ago

Was this helpful?

It is recommended that you use Postman to connect to staging and production and run GraphQL. First add a new query type POST, and add the GraphQL endpoint (for example ``), then go to Authorization and select Bearer Token, then add your token in the input field:

https://moped-graphql-staging.austinmobility.io/v1/graphql