Oracle Database Support for GraphQL
Advancements in relational database technologies have further amplified the benefits of GraphQL. Oracle AI Database now provides the support for integrating GraphQL by providing means to query the database directly without using custom resolvers.
Through Oracle Database Support for GraphQL Queries, you can effortlessly create, introspect, and query complex data objects without sacrificing the performance, scalability, or optimization provided by relational databases. Automated schema inference from relational structures streamlines the querying process, making GraphQL a seamless add-on to established relational storage models.
Table 1-1 GraphQL Query vs Oracle Supported GraphQL Table Function
Standard GraphQL Query | Oracle AI Database Supported GraphQL Table Function | |
---|---|---|
Sample Query |
|
|
Output | The GraphQL query will produce one JSON document, which will contain data from all races. | The Oracle AI Database Supported Table Function for GraphQL Queries will create and return one row per race. |
- Custom directives to specify the joining columns
- Arguments to specify the predicates
- Query-By-Example (QBE) Operators to specify the predicates
- Limit Argument to explicitly specify the number of rows to be returned
- Using SQL binds as GraphQL variables
- Specify GraphQL comments within the table function
- Using SQL operators with the table function
Since GraphQL query is embedded inside a SQL query, existing SQL tools used for diagnosability, performance measurement, and performance optimization such as AWR, SQL Monitor, SQL Tracing, SQL Hints can also be used with the Oracle Database supported GraphQL queries.
Complementing this, Oracle AI Database 26ai offers JSON Relational Duality, a paradigm allowing data to reside in normalized relational tables while being accessed as flexible, developer-friendly JSON documents. Oracle Database Support for GraphQL Queries allows you to create the Duality Views, which are defined using an intuitive GraphQL-like syntax to bridge the structured relational model with modern application needs. Duality Views make it straightforward to create, and query complex data objects while retaining the performance and scalability benefits of relational storage. These approaches collectively streamline querying and data manipulation by enabling automated schema inference from relational models and seamless GraphQL integration with databases.
This book covers only the most basic information related to integrating GraphQL to Oracle AI Database. It is assumed that you are familiar with the concept of JSON-relational duality views and have brief knowledge about the GraphQL standard. Oracle recommends referring to the official documentation and specifications from GraphQL to gain a complete picture. Refer to JSON-Relational Duality Developer's Guide for understanding the concepts of JSON-relational duality views. The popular car racing example is used to illustrate GraphQL integration into the Oracle AI Database.