Git Product home page Git Product logo

graphiql's Introduction

GraphiQL Client

NOTE For Washington DC Users--GraphiQL is now included OOB for W+ Look for "GraphQL Explorer"

A simple ServiceNow GraphiQL implementation that allows you to make queries from within your instance.

Based on the https://github.com/graphql/graphiql repo, specifically the CDN Example.

Do Not Install on a Prod Instance--for Dev Use Only

NOTE: An important side-effect of using this versus an external 3rd party tool is the ability to set breakpoints in your resolvers since the session is the same.

Installation

  1. Simply use source control to fork this repo and install that into your ServiceNow instance using Studio. (Use the "Fork" button at the top right of this page.)
  2. Make sure that introspection is enabled at "System Web Services > GraphQL > Properties" (NOTE: DO THIS FOR DEV INSTANCES ONLY).
  3. Note: turning on GlideRecord introspection means that the entire schema of all your tables and fields will be downloaded. Needless to say this will take a couple of minutes each time the schema updates in the client. If you are not using the GlideRecord_Query API you will want to leave this off, but luckily you only take this hit the first time you load the GraphQL client each day.

Usage

Navigate to "System Web Services > GraphQL > GraphiQL Explorer" (note the "i" in the name versus the OOB client).

Available at the path: /now/nav/ui/classic/params/target/x_snc_graphiql_gql.do

Type "{" then ctrl-space in the editor and you will see the available GraphQL Services auto complete.

Sample query:

query ($limit: Int = 5, $queryConditions: "active=true") {
  GlideRecord_Query {
    incident(queryConditions: $queryConditions, pagination: {limit: $limit}) {
      _rowCount
      _results {
        short_description {
          value
        }
        sys_id {
          value
        }
        state {
          value
          displayValue
        }
      }
    }
  }
}

graphiql's People

Contributors

jon-lind-sn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.