- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 08-29-2020 05:06 AM
What is GraphQL?
GraphQL is a query language API used to load data from Server to client which gives client exactly the data which they request and nothing more than that in JSON format.
Benefits of GraphQL:
- Makes easy to aggregate data from different different sources
- One API to get data from multiple tables in ServiceNow.
- Fast, Flexible and developer friendly.
- GraphQL does not dictate a specific application architecture. It can be introduced on top of an existing REST API and can work with existing API management tools.
- Schema can be made public.
- very efficient and scale-able.
GraphQL Vs REST?
- GraphQL is a query language and REST is an architectural pattern.
- REST returns whole data object for the component but GraphQL returns what you asked for.
- In REST, the shape and size of the resource is determined by the server. In GraphQL, the server declares what resources are available, and the client asks for what it needs at the time.
- Developers can summarize multiple API calls in one. Doing so allows them to focus on the business logic instead of combining call results, handling different transactions.
Will REST Fade Away?
Personally i believe NO it will not because it has its own advantages over GraphQL. REST is in market for a while now and its not easy to replace REST with GraphQL, one reason been lack of tools support for GraphQL.
See this link which gives you lot of information about this https://goodapi.co/blog/rest-vs-graphql
Now lets come to an actual demo and how this will be helpful in ServiceNow for us as a Developer and will this solve real time issues for us or not. So lets deep dive into this concept and see what GraphQL brings to Us. I will explain GraphQL components by taking a simple example in following sections.
Use Case
Retrieve Incident details along with child incidents.
Solution:
I don't want to bore you by creating a huge article so i have explained GraphQL, its components and Use case above in this video. Watch this and get started with GraphQL.
References:
https://github.com/noxify/ServiceNow-GraphQL-Example
Please don’t forget to mark helpful ,bookmark this article and subscribe my Youtube channel.
Thanks and Regards,
Ashutosh Munot
- 1,536 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Dear
thanks for creating the video howto.
It would be nice if you would mention me as original author of the used source.
For everyone else:
If you need the source, feel free to visit my repo:
https://github.com/noxify/ServiceNow-GraphQL-Example
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Great post!
I've also created a quick tutorial for using GraphQL to query the existing ServiceNow tables available here: https://community.servicenow.com/community?id=community_blog&sys_id=d1ad30c91b94e010d2ccea89bd4bcbb9
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Nice Nathan. Awesome Blog.
Thanks,
Ashutosh
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi,
Thank you for your hard work.
I followed all of the steps from the script includes to the GraphQLAPIs module, but I'm getting a null return in Insomnia. What could I be missing?