Search Results for

    Show / Hide Table of Contents

    GraphQL for Delphi introduction

    What is GraphQL?

    GraphQL is a modern way to build HTTP APIs consumed by the web and mobile clients. It is intended to be an alternative to REST and SOAP APIs (even for existing applications).

    From GraphQL itself:

    GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.

    GraphQL provides a standard way to:

    • describe data provided by a server in a statically typed Schema;
    • request data in a Query which exactly describes your data requirements; and
    • receive data in a Response containing only the data you requested.

    GraphQL was developed internally by Facebook in 2012 before being publicly released in 2015. Learn more about GraphQL language at https://graphql.org/learn/.

    About GraphQL for Delphi

    GraphQL for Delphi is an implementation of GraphQL specification for Delphi.

    GraphQL request is validated and executed by GraphQL server with the schema of the GraphQL service and a GraphQL document which contains the operations.

    GraphQL for Delphi supports Delphi 10 Seattle and later versions up to the most recent one.

    Features

    Below is a list of exists GraphQL for Delphi features and GraphQL specification elements covered.

    • Full GraphQL document parser with support to:
      • Full spec-compliant document lexer;
      • Executable documents and type definition documents;
      • Operations;
      • Selection sets;
      • Fields;
      • Arguments;
      • Field aliases;
      • Fragments (including inline and type conditions);
      • Input values;
      • All types supported (Int, String, Object, etc.);
      • Variables;
      • Type references (List, Non-Null);
      • Directives.
    • GraphQL schema supporting the following types:
      • Query and Mutation root types;
      • Scalars: Int, Float, String, Boolean and ID;
      • Objects, field arguments and field deprecation;
      • Interfaces;
      • Unions;
      • Enums;
      • Input objects;
      • List types;
      • Non-null types;
      • Directives, including @skip, @include and @deprecated.
    • Full Introspection support;
    • Full Validation support;
    • Spec-compliant GraphQL document execution (*)
      • Execute a GraphQL document based on a schema and retrieve results;
      • Execution strictly following GraphQL specification;
      • Skip/include directives handling;
      • Fragments;
      • Selection set execution;
      • Variables;
      • Fields and variables values coercion;
      • Field resolvers and abstract type resolvers;
      • Proper error handling in response with precise error location and extensions;
      • Automatic field resolver binding using RTTI.
    • GraphQL over HTTP:
      • GraphQL HTTP handler compliant to upcoming GraphQL over HTTP specification;
      • WebBroker dispatcher component:
        • Support for Windows and Linux servers (**);
        • Deploy with Apache, IIS, FastCGI, Standalone (***);
      • Automatic JSON serialization/deserialization.
    • GraphQL Playground IDE built-in:
      • Execute queries and debug your GraphQL server from web easily by enabling GraphQL Playground;
      • Fully customizable (light/dark theme, title, etc.).
    • Fully extensible:
      • Abstract HTTP request/response allows using the GraphQL HTTP handler with any Delphi HTTP framework;
      • Inheritable schema types allows creating your GraphQL types, including scalars.
    • Extensive documentation including full API reference.
    • Supports from Delphi 10 Seattle up to the latest available Delphi version.
    • Platforms support: Windows, Linux, macOS, Android and iOS.
    • Premium support.

    (*) Unsupported features still under work: type extensions and subscriptions.

    (**) Linux support requires Delphi Enterprise with Linux compiler.

    (***) Functionality provided by WebBroker technology itself.

    Documentation Topics

    Please refer to the following topics in this documentation. This guide is also available as PDF at graphql-user-guide.pdf and as Microsoft Compiled HTML Help at graphqldoc.chm.

    In this section:

    Getting started

    Getting started with GraphQL for Delphi.

    Schema

    Understanding GraphQL schema and creating a schema document.

    Release Notes

    List of releases, new features added and bugs fixed.

    Breaking Changes

    Information about breaking changes introduced by released.

    Copyright Notice

    Copyright information about this library.

    In This Article
    Back to top GraphQL for Delphi v1.4
    © 2021 - 2024 tmssoftware.com