Skip to content

Commit

Permalink
W-17274151 Update apex-import.md to add GraphQL context and doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
clivewong committed Nov 21, 2024
1 parent 71f8b1b commit 17fa120
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/docs/apex-import.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# apex-import

Using Apex in LWC Offline-enabled mobile apps requires additional considerations to ensure proper functioning in offline scenarios.
Using Apex in LWC Offline-enabled mobile apps requires additional considerations to ensure proper functioning in offline scenarios. Consider using GraphQL for mobile offline use cases.

When a client device is offline, Apex-based features can read data that was cached while online, but changes (writing data) can’t be saved back to the server. Nor can a change via Apex methods be enqueued as a draft into the Offline Queue. A Lightning web component that uses Apex must be prepared to handle a network connection error as a normal response, for both reading and writing operations.

See [Use Apex While Mobile and Offline](https://developer.salesforce.com/docs/atlas.en-us.mobile_offline.meta/mobile_offline/apex.htm) for more details.
GraphQL is a flexible, powerful query language for accessing record and other data. You can think of GraphQL as a modern equivalent of SQL, the query language for relational databases.

Developers like GraphQL for modern web applications because, in contrast to many REST and CRUD-oriented APIs, GraphQL allows for expressive queries, with features like filtering and scopes, ordering and aggregation, pagination, and relationship traversal to related records. A single query can retrieve many records, and even records of multiple types. Using fewer queries reduces the number of server requests required to load data, which can improve performance. A GraphQL query can specify precisely and only the fields required for a given component, reducing the amount of data that needs to be transmitted before a page can render.

For mobile developers building apps that work while offline, however, there is only one implementation that matters: Offline GraphQL.

See [Use GraphQL While Mobile and Offline](https://developer.salesforce.com/docs/atlas.en-us.mobile_offline.meta/mobile_offline/apex.htm) and [GraphQL Wire Adapter for LWC](https://developer.salesforce.com/docs/platform/graphql/guide/graphql-wire-lwc.html) for more details.

0 comments on commit 17fa120

Please sign in to comment.