Slide 1

Slide 1 text

#LDNsCall #LC23 Bring data to your LWC without Apex using the GraphQL Wire Adapter Fabien Taillon https://trailblazer.me/id/fabien https://www.linkedin.com/in/fabientaillon https://twitter.com/FabienTaillon

Slide 2

Slide 2 text

Who am I Fabien Taillon - 8x Salesforce MVP - CTO at Texeï - Paris Developer Group leader - French Touch Dreamin team - Serial speaker @FabienTaillon https://texei.com/blog

Slide 3

Slide 3 text

- Created by Facebook in 2012 - No need to call several APIs - Get many resources in a single request - Ask for what you need, get exactly that - Self documented - With a type system A query language for your API What is GraphQL source: Michael Poirier-Ginter

Slide 4

Slide 4 text

- a read only stream of data - shared cache between components (standard & custom) - reactive to changes outside of the component’s scope - no Apex with standard Lightning Data Service Wire Adapters - just import it and use it 🎉 What is a Wire Adapter

Slide 5

Slide 5 text

A GAME CHANGER What is the GraphQL Wire Adapter

Slide 6

Slide 6 text

Query any list of records you want - Order them - Group them - … Easy to use because - you don’t need to write any Apex - respects user Field Level Security - use the same shared Lightning Data Service cache Get for a custom component - a list of all contacts for a given account - a search page - a hierarchy of records - one specific record with filters, without knowing its Id at first - … What is the GraphQL Wire Adapter

Slide 7

Slide 7 text

An easy to use local client to test your queries - Get an access token - for instance use sf org display - Use the following url: - https://{MyDomainName}.my.salesforce.com/services/data/v{version}/graphql - Then you can: - query - autocomplete - look at API documentation (display existing fields, available formatting etc) https://ww.altairgraphql.dev Altair GraphQL Client Connect to GraphQL API

Slide 8

Slide 8 text

DEMO GraphQL Wire Adapter

Slide 9

Slide 9 text

GraphQL Wire Adapter Filter, order, query relationships, use variables…

Slide 10

Slide 10 text

GraphQL Wire Adapter Filter, order, query relationships, use variables…

Slide 11

Slide 11 text

GraphQL Wire Adapter Filter, order, query relationships, use variables…

Slide 12

Slide 12 text

GraphQL Wire Adapter Filter, order, query relationships, use variables…

Slide 13

Slide 13 text

- Backward pagination - Filter with no value - Actually more GraphQL than Salesforce “issue” - No mutation (on the roadmap) What’s not available (yet ?)

Slide 14

Slide 14 text

https://trailhead.salesforce.com/trailblazer-community/groups/0F94S000000kRExSAM Join the GraphQL API & LWC Wire Adapter Trailblazer Community Group GraphQL API & LWC Wire Adapter Community Group

Slide 15

Slide 15 text

Demo source code: https://github.com/FabienTaillon/graphql-wire-adapter-demo Developer Guide: https://developer.salesforce.com/docs/platform/graphql/guide/graphql-wire-lwc.html GraphQL Wire Adapter for LWC Blog Post: https://developer.salesforce.com/blogs/2023/02/now-in-pilot-graphql-wire-adapter-for-lwc GraphQL API & LWC Wire Adapter Trailblazer Community Group: https://trailhead.salesforce.com/trailblazer-community/groups/0F94S000000kRExSAM Resources

Slide 16

Slide 16 text

#LDNsCall #LC23 Q&A Fabien Taillon https://trailblazer.me/id/fabien https://www.linkedin.com/in/fabientaillon https://twitter.com/FabienTaillon

Slide 17

Slide 17 text

#LDNsCall #LC23 Thank You Fabien Taillon https://trailblazer.me/id/fabien https://www.linkedin.com/in/fabientaillon https://twitter.com/FabienTaillon