getGraphQLClient

Use this method to create the GraphQL client that will communicate with the server that contains the schema. Pass the configuration parameters to get the client.

getGraphQLClient(parameterStruct) → returns any

This function requires Adobe ColdFusion 2023 and up.  Not supported on Lucee, etc.

Argument Reference

parameterStruct struct
Required

A structure defining the properties of the GraphQL client

Links more information about getGraphQLClient

Examples
Sample code invoking the getGraphQLClient function

Creates a GraphQL client with specified properties

gqlClient = getGraphQLClient({
    service_name: "server-name",
    type: "graphqlclient",
    raw_http_client: true,
    service_url: "endpoint-url",
    root_folder: "root_folder",
    headers: { values: "auth-value", keys: "auth-key" },
    batching_configuration: { enabled: true, batch_interval_ms: 10, max_batch_size: 15 },
    subscription_configuration: { websocket_url: "wss://websocket-url", subscription_heartbeat_timeout: 5, subscription_heartbeat_timeunit: "nano" }
});

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub