Use the GraphQL Wire Adapter

Retrieve specific records, fields, and object information in a single server call using the GraphQL wire adapter. With built-in shared caching, Lightning Data Service manages your data and you don’t need different wire adapters for each GraphQL query you define.

The GraphQL wire adapter provides access to the Salesforce GraphQL API, enabling you to work with UI API enabled objects with the object-level security and field-level security of the context user. The schema exposed by the GraphQL API dictates what you can do with the GraphQL wire adapter.

The GraphQL wire adapter supports the same capabilities as the GraphQL API, except as noted in GraphQL API Wire Adapter Limitations.

To get started, you can view the schema for your org using the Altair GraphQL Client. The client provides a query editor that includes field auto-completion, enabling you to add fields easily for a given type on any Salesforce object. We recommend that you use this client to help you build your queries quickly and accurately.

The lwc-recipes repo presents helpful examples to help you quickly get started on the GraphQL wire adapter.

This documentation assumes that you already have your LWC development environment set up.