GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. It is an open source data query language. Developed by Facebook in 2012 for its own use, it was moved to the Graph QL Foundation in 2018.
In this article, let us explore GraphQL (https://graphql.org/), which is a specification from Facebook.
GraphQL is a query language for APIs and a runtime for fulfilling those API queries with your existing data. It gives clients the power to ask for exactly what they need and nothing more, by avoiding over-fetching or under fetching of data. We can understand it more when we see GraphQL implementation in action. Till then, restrain your curiosity. So far we have been using REST (Representation State Transfer) to expose our services as APIs. Let us ask ourselves some questions before going deeper into GraphQL.
Why do I need to adopt GraphQL?
What problems am I facing with REST APIs and how does GraphQL solve them? To answer these queries, let us take a use case of building an e-commerce application for the Web, mobile and native clients. Let’s first expose APIs for various e-commerce functionalities. For example, I have the product detail REST API, which gives specific product information as JSON — this includes product data attributes, specifications data, reviews data, etc. As we have many attributes in product JSON, this is larger in size. Each client (Web and thin client — mobile and tablets) has its own frontend requirements to display product data, as each has different screen sizes, memory, network bandwidth, etc. Now, the clients start consuming the product detail API. Though mobile and tablet interfaces don’t require the entire product JSON as Web does, even then the product detail API gives the entire product data. It is evident that clients don’t have control over the data they want from the server. This is called over-fetching. The pictorial representation of the REST over-fetching issue is shown in Figure 2.
This story is from the May 2019 edition of Open Source For You.
Start your 7-day Magzter GOLD free trial to access thousands of curated premium stories, and 8,500+ magazines and newspapers.
Already a subscriber ? Sign In
This story is from the May 2019 edition of Open Source For You.
Start your 7-day Magzter GOLD free trial to access thousands of curated premium stories, and 8,500+ magazines and newspapers.
Already a subscriber? Sign In
The Crucial Role of Open Source in Advancing Blockchain Technology
Open source and blockchain technology are like soulmates, forging connections, building bridges, and working together to create a future that is more open, inclusive, and equitable.
Why Open Source Dependencies Must be Managed
Unmanaged reliance on open source software may result in a Support crisis over a project’s life span, as well as financial loss for the organisation. Planned and regular upgrades of open source software components are a must.
Why Cloud Security Alone is Not Enough for Enterprises
Traditional and off-the-shelf security tools for the cloud may lull organisations into a false sense of being safe from cyber threats. This first article in the two-part series explains why organisations must develop an enterprise cloud security governance strategy’.
Openchain: Revolutionising Supply Chain Management
Openchain’s unique features cater specifically to enhancing supply chain management. This distributed ledger technology is helping to build a future where supply chains are more transparent, efficient, and secure.
Open Source, Private and Public Blockchain Platforms: What They Offer
Open source platforms play a crucial role in driving innovation and democratising access to blockchain technology. These platforms promise to have a significant impact on the future of society by offering a range of benefits.
Why Choose Hyperledger Sawtooth?
Hyperledger Sawtooth has earned a formidable reputation as a champion of modularity in the realm of enterprise blockchains. We delve into its components and functionalities, as well as the advantages it offers businesses seeking custom-crafted blockchain solutions.
Hyperledger Fabric: What You Should Know and Why
Understanding the essential features of Hyperledger Fabric is crucial for anyone looking to develop blockchain applications for enterprise use. These features provide the foundation for building secure, scalable, and privacy-focused applications, and can be leveraged to create innovative solutions that address real-world business challenges.
The Metaverse and Blockchain Technology: What the Future Holds
The integration of the metaverse with blockchain technology has opened exciting possibilities for managing digital assets in virtual environments. As virtual worlds become increasingly immersive and interconnected, the need for secure and efficient asset management solutions has never been greater.
Machine Learning Basics for a Newbie
Machine learning is a vast and rapidly evolving field, and this article serves as a stepping stone for those new to the domain. Explore the fundamental concepts of machine learning, from understanding the differences between traditional programming and ML to delving into various types of machine learning algorithms.
Human-AI Collaboration is the Future
Al-augmented decision making is making a transformative impact across various fields, benefiting a range of industries.