Graphql ServiceNow Integration

Поділитися
Вставка
  • Опубліковано 9 лют 2025
  • Graphql ServiceNow integration.
    What is GraphQL?
    GraphQL is a query language for API's and a runtime for fulfilling queries with existing data.
    Instrictions to setting up GraphQL with Servicenow:
    1. GraphQL API (sys_graphql_schema)
    2. GraphQL Scripted Resolvers (sys_graphql_resolver)
    3. GraphQL Resolver Mappings (sys_graphql_resolver_mapping)
    4. End Point ([my-instance].service-now.com/api/now/graphql)
    In this video, we also covered the Advantages/Disadvantages of GraphQL
    ServiceNow
    Script used in the video:
    _____________________________________________________________
    1.GraphQL API:
    schema {
    query: Query
    }
    type Query {
    getIncidentsByCallerID(calledID: ID!): [IncidentData]
    }
    type IncidentData{
    number: DisplaybleString,
    short_description: String
    }
    type DisplaybleString{
    value: String,
    display_value: String
    }
    _____________________________________________________________
    2. GraphQL Scripted Resolver:
    (function process(/*ResolverEnvironment*/ env) {
    var grIncident = new GlideRecord('incident');
    grIncident.addEncodedQuery("caller_id="+env.getArguments().calledID);
    grIncident.query();
    return grIncident;
    })(env);
    _____________________________________________________________
    3. Syntax to Test:
    {
    x200273 {
    agineo{
    contactRequest(contactID: "6816f79cc0a8016401c5a33be04be441"){
    short_description,
    number{
    value
    }
    }
    }
    }
    }
    If you have any questions please mention them in the comments below.
    Please feel free to comment whats the next video you are looking for.

КОМЕНТАРІ • 2

  • @SupriyaA-h1g
    @SupriyaA-h1g 2 місяці тому +1

    Nice..! you should have done more videos on GraphQL

  • @susmitobhattacharyya1668
    @susmitobhattacharyya1668 4 дні тому

    awesome video. how do we call graphl from server/client side?