pg_graphql's public facing SQL interface consists of a single SQL function to resolve GraphQL requests. All other entities in the graphql schema are private.
graphql.resolve
description
Resolves a GraphQL query, returning JSONB.
signature
1 2 3 4 5 6 7 8 910111213141516
graphql.resolve(-- graphql query/mutationquerytext,-- json key/values pairs for variablesvariablesjsonbdefault'{}'::jsonb,-- the name of the graphql operation in *query* to execute"operationName"textdefaultnull,-- extensions to include in the requestextensionsjsonbdefaultnull,)returnsjsonbstrictvolatileparallelsafelanguageplpgsql
-- Create the extensiongraphqldb=createextensionpg_graphql;CREATEEXTENSION-- Create an example tablegraphqldb=createtablebook(idintprimarykey,titletext);CREATETABLE-- Insert a recordgraphqldb=insertintobook(id,title)values(1,'book 1');INSERT01-- Query the table via GraphQLgraphqldb=selectgraphql.resolve($$query{bookCollection{edges{node{id}}}}$$);resolve----------------------------------------------------------------------{"data":{"bookCollection":{"edges":[{"node":{"id":1}}]}},"errors":[]}