Consider removing baseQuery in favour of explicity requiring the params in each api call

Created on 26 November 2024, 3 months ago

Overview

In πŸ“Œ Make store API paths/uris configurable via environment variables (and eventually drupalSettings) Needs work we introduced baseQuery which takes care of auto-replacing {entity_type} and {entity_id} in API paths.
When I wrote this I thought it was a good idea, but on client projects since I've been favouring requiring the params to be explicitly passed to any invocation of any API methods returned from rtk-query as the 'extra' argument.
This makes it more evident which components depend on the configuration values (e.g. entity type and id) rather than transparently (magically?) hiding it in the baseQuery

Proposed resolution

Make the all callers of query functions from the API client pass along entity type and ID themselves https://redux-toolkit.js.org/rtk-query/api/createApi#queryfn

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Page builder

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024