GraphQL query fails prefetch with an "Unknown Field" warning

Platform / Development (Apex, LWC & VF)
Solution Scheduled

Created

Sep 19, 2023

Found in Release

Winter '24

Last Updated

Jan 4, 2024

Reference ID

W-14088402

Summary

In Spring '23, you had to include metaschema directives (@category) in GraphQL queries that were embedded within Lightning web components (LWCs). In Summer '23, Salesforce automatically generates these directives when you deploy LWCs to the org, and you were instructed to remove the hardcoded metaschema directives from your GraphQL queries.


However, in mobile environments such as in the Salesforce mobile app, Salesforce Field Service, or Mobile Offline, these custom Lightning web components with GraphQL queries can fail during prefetch. This failure occurs in mobile apps when running GraphQL queries offline that have previously been prefetched.

Error Details

Unknown Field / cannot participate in normalization

Steps to Reproduce

GraphQL queries in custom LWCs can't be primed for mobile offline use, which worked previously when metaschema directives must be manually added in the GraphQL queries.

Workaround

We recommend that you disable metaschema generation if you encounter this prefetch issue. To disable metaschema generation, please contact your CS partner to initiate this temporary work around. After disabling metaschema generation, you must manually add metaschema directives to your GraphQL queries, which also preserves priming functionality.

Note that disabling metaschema generation also disables referential integrity for GraphQL queries. Any entity or field renames or deletes may cause compilation errors in the LWC components that you will need to manually resolve.

Reference IDW-14088402
Solution Scheduled

4 Reports

4 Reports