Skip to Content
GraphQL for Modern Commerce
book

GraphQL for Modern Commerce

by Kelly Goetsch
February 2020
Intermediate to advanced
75 pages
1h 27m
English
O'Reilly Media, Inc.
Content preview from GraphQL for Modern Commerce

Chapter 2. The GraphQL Specification

A specification allows all parties to work together with a common language and syntax. Specifications are everywhere. Motorists drive their cars on the same side of the road, obey stop lights, obey posted road signs, and follow other local regulations. Without clearly defined rules, traffic collisions would happen everywhere. Written languages are an example of another specification, with Arabic and Hebrew specifications calling for text to be written right to left, whereas English and German specifications call for text to be written left to right.

In the technology realm, some common technologies have a specification and some do not. XML has a very strict standard. From the formal specification, you’ll find many examples like this:

The formal grammar of XML is given in this specification using a simple Extended Backus-Naur Form (EBNF) notation. Each rule in the grammar defines one symbol, in the form

symbol ::= expression

Symbols are written with an initial capital letter if they are the start symbol of a regular language, otherwise with an initial lowercase letter. Literal strings are quoted.

Any human or software that writes or reads an XML document can make sure the document is valid because there’s a strict specification.

As previously discussed, REST doesn’t have a specification. A REST endpoint can return a response in a specific standards-compliant version of JSON or XML, but you’ll find little agreement across REST endpoints on how ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

APIs for Modern Commerce

APIs for Modern Commerce

Kelly Goetsch

Publisher Resources

ISBN: 9781492056850