GraphQL API Schema for Service Decoupling

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing API systems face inefficiencies in processing read and write requests due to differences in service conventions, leading to overfetching and underfetching, and require complex re-compilation and deployment with increasing numbers of services, which wastes resources and complicates maintenance.

Innovation Solution

The method involves generating data records based on object and service definitions, publishing messages on a message bus for data lake processing, and using declarative schemas to define APIs, allowing for efficient north-south and east-west data processing, decoupling services, and versioning data for consistency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If RESTful services are used to expose API functions, then services can be accessed programmatically via standard protocols, but overfetching and underfetching occur leading to data retrieval inefficiencies

Engineering Contradiction:
ImproveAPI accessibilityVSAvoiddata retrieval efficiency
Core Design Contradiction:
Ease of operationVSProductivity

Solution Approach 1:

The patent introduces a GraphQL layer as an intermediary between the client and RESTful services. This GraphQL API acts as a mediator that receives client queries, translates them into efficient service calls, and returns precisely the requested data. The GraphQL schema defines the data model and relationships, allowing clients to specify exactly what data they need without overfetching or underfetching, while the backend uses this schema to generate optimal service invocation plans.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If individual service conventions are allowed to differ, then each service can be maintained independently, but significant challenges arise in the user interface layer that relies on multiple service APIs

Engineering Contradiction:
Improveservice independenceVSAvoiduser interface complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent implements a universal GraphQL schema that serves as a common interface for all services. This schema acts as a multi-functional contract that can represent data from any service while maintaining a consistent structure. The schema includes type definitions, field definitions, and relationship definitions that work across all services, allowing the user interface to interact with a unified data model regardless of the underlying service heterogeneity.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The GraphQL layer serves as an intermediary that translates between diverse service conventions and a unified interface. It receives requests in a consistent format, determines which services need to be called, and returns data in a unified format. This mediator pattern allows services to maintain their independence while presenting a cohesive interface to the user layer.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Adaptability or versatility

If the number of services in the API increases, then more functionality can be provided, but complex re-compilation and deployment is required which wastes resources and complicates maintenance

Engineering Contradiction:
ImproveAPI functionalityVSAvoidcompilation and deployment complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments the API into independent services, each with its own data model and logic, while using a centralized GraphQL schema that orchestrates them. The schema is divided into type definitions that can be independently maintained for each service, but combined to form a complete API. This segmentation allows services to be developed, compiled, and deployed independently while the GraphQL layer composes them into a unified interface.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system dynamically generates service invocation plans based on the GraphQL schema and the specific query being executed. Rather than requiring static compilation of all possible service interactions, the system adapts the service call graph at runtime based on what data the client actually needs. This dynamic approach reduces unnecessary compilation and deployment complexity while maintaining full functionality.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS11620312B2Method and system for processing write queries in an application programming interface based on declarative schemas for individual services
Publication Date: 2023.04.04 INTUIT INC
  • US11620312B2 patent drawing
  • US11620312B2 patent drawing
  • US11620312B2 patent drawing

AI summary

Certain aspects of the present disclosure provide techniques for processing north-south queries in an application programming interface (API) generated for a plurality of associated services. The method generally includes receiving a request to invoke a function exposed by a first service in the API, wherein the function commits data to one or more data repositories. A data record is generated by the first service based on the received request based on a data object definition and a service definition for the first service. A message is generated including the generated data record and an indication that the message is to be consumed by a data lake processing system to commit data to a data lake. The message is published on a message bus for consumption by the data lake processing system.