Home Applications GraphQL

GraphQL

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
0
0 reviews
0
Awards
640
Views
0
IPM installs
1
3
Details
Releases  (1)
Reviews
Issues
GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

What's new in this version

2018.1

GraphQL implementation for InterSystems Data Platforms

Gitter
Gitter
Demo:

Install GraphQL

  1. Download the last release.
  2. Import it to the target Caché namespace, f.e. to SAMPLES.
  3. Create new web aplication:
    • Name - /
    • Namespace - your target namespace, f.e. SAMPLES
    • Dispatch Class - GraphQL.REST.Main

Install GraphiQL

  1. Use an available release or build it on your own
  2. Create new web aplication:
    • Name - /graphiql
    • Namespace - your target namespace, f.e. SAMPLES
    • CSP Files Physical Path - f.e. C:\InterSystems\GraphiQL\

Installation with ZPM

If the current ZPM instance is not installed, then in one line you can install the latest version of ZPM even with a proxy.

s r=##class(%Net.HttpRequest).%New(),proxy=$System.Util.GetEnviron("https_proxy") Do ##class(%Net.URLParser).Parse(proxy,.pr) s:$G(pr("host"))'="" r.ProxyHTTPS=1,r.ProxyTunnel=1,r.ProxyPort=pr("port"),r.ProxyServer=pr("host") s:$G(pr("username"))'=""&&($G(pr("password"))'="") r.ProxyAuthorization="Basic "_$system.Encryption.Base64Encode(pr("username")_":"_pr("password")) set r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")

If ZPM is installed, then ZAPM can be set with the command

zpm:USER>install isc-graphql

Installation with Docker

Prerequisites

Make sure you have git and Docker desktop installed.

Installation

Clone/git pull the repo into any local directory

$ git clone https://github.com/intersystems-community/GraphQL.git

Open the terminal in this directory and run:

$ docker-compose build
  1. Run the IRIS container with your project:
$ docker-compose up -d

Example

Query and Result

sample sample

sample sample

Example queries for copy and past on Demo:

Queries can be simple and complex for several sets of data

{
  Sample_Person{
    Name
    DOB
    FavoriteColors
    Office {
      City
      State
      Street
      Zip
    }
  }
  Sample_Company{
    Mission
    Name
    Revenue
  }
}

Filtering

At the moment, only strict equality is supported:

{
  Sample_Person(id: 116){
    id
    Name
    DOB
    FavoriteColors
    Home {
      City
      State
      Street
      Zip
    }
    Office {
      City
      State
      Street
      Zip
    }
  }
}

Pagination

Pagination is supported through 4 functions that can be combined to achieve the necessary result:

  • after: n – all records with id greater than n
  • before: n – all records with id smaller than n
  • first: n – first n records
  • last: n – last n records
{
  Sample_Employee(after: 120, before: 123){
    id 
    Name
  }

Sample_Person(first: 2){
id
Home {
City
State
Street
Zip
}
}
Sample_Company(last: 3){
id
Name
}
}

Made with
Version
1.016 Sep, 2022
Ideas portal
https://ideas.intersystems.com/ideas/DPI-I-201
Category
Developer Environment
Works with
CachéEnsembleHealthShareInterSystems IRIS
First published
17 Jul, 2018
Last checked by moderator
26 Nov, 2024Doesn't work