@gadget-client/blog
Changelog
The @gadget-client/blog
npm package is generated by Gadget specifically for the blog app. The models, types, and functions are generated based on the backend Gadget resources and configuration. New versions of @gadget-client/blog
are published for each backend change. See Installing for more information on installing this package.
This page documents the global behavior changes made to the generated API client over time. Changes to your Gadget app after each of the dates below will generate a new package version that includes the changes listed below that date.
Dec 12th, 2022
- API clients instantiated without the
environment
option will default to theNODE_ENV
environment if it is set to eitherdevelopment
orproduction
Dec 2nd, 2022
Fixed a bug where API clients instantiated for different Gadget apps on the same host would share the same auth token. This happened a lot on
locahost
. Now, tokens are keyed by the endpoint they should be sent to, so auth state and login state is separate per Gadget app and environment. (https://github.com/gadget-inc/js-clients/pull/134)Fixed the default browser authentication mode (
BrowserSessionStorageType.Durable
) to gracefully fall back to an in-memory storage option whenwindow.localStorage
isn't available or doesn't work. This is the case in Incognito mode in Chrome and Private Browsing mode in Safari. WhenlocalStorage
isn't available, session state will only last as long as the tab does, and will reset on page navigation. Note: Shopify App developers using@gadgetinc/react-shopify-app-bridge
use a special auth mechanism using Shopify Session tokens that is unaffected by this change. (https://github.com/gadget-inc/js-clients/pull/136)
Nov 25th, 2022
Fixed a bug where the react hooks would return responses from the in-memory, client-side cache unless explicitly told to make a network request. See (https://github.com/gadget-inc/js-clients/pull/130). This changed the default urql
requestPolicy
fromcache-only
tocache-and-network
. See more details aboutrequestPolicy
here: https://github.com/gadget-inc/js-clients/tree/main/packages/react#request-caching . Released in@gadgetinc/api-client-core
v0.11.0.Fixed a bug where the
useFindMany
React hook would not return pagination information on the result array. After this fix, theresult
object returned from the hook will include the.hasNextPage
,.hasPreviousPage
,.startCursor
and.endCursor
properties. Released in@gadgetinc/react
v0.8.3. See https://github.com/gadget-inc/js-clients/pull/131 .
Nov 24th, 2022
- Stopped automatically fetching relationships of models when no
select:
param is passed to a record finder. This means faster API calls for a better user experience and fewer unexpectedGGT_PERMISSION_DENIED
errors.
For example, if you were previously running const record = await api.widget.findOne(1)
, or const [{data: record}] = useFindOne(api.widget, 1)
, the record
object would have all its relationship fields populated with data from the other models the Widget model has relationships to. After this change, the record
object will only have fields that are stored on the Widget model itself. If you want to include related data, you must explicitly select it with the select:
param. You can find an example documentation page for an app's select:
param here.
Nov 21st, 2022
- Fixed bug with
api.directUploadToken()
returning duplicate tokens if called multiple times in the same browser context
Sept 19th, 2022
- Added a
.currentChanges
function toGadgetRecord
for listing the current values of changed fields (https://github.com/gadget-inc/js-clients/pull/101)
July 29th, 2022
- Target ES2019 in published package JS for better next.js minification support out of the box (https://github.com/gadget-inc/js-clients/pull/55)
May 18th, 2022
- Remove dependency on
lodash
for smaller package size (https://github.com/gadget-inc/js-clients/pull/42)
March 31st, 2022
- Add
findFirst
,maybeFindFirst
,maybeFindOne
functions (https://github.com/gadget-inc/js-clients/pull/30)
January 20th, 2022
- Turn on
urql
's caching by default in the browser (https://github.com/gadget-inc/js-clients/pull/17)
Nov 21st, 2021
- Add support for uploading files with the
urql
multipart exchange upload (https://github.com/gadget-inc/js-clients/pull/14)
October 10th, 2021
- API client package introduced with type safety, easy pagination, data hydration and more. See https://gadget.dev/blog/type-safe-javascript-api-clients-on-all-gadget-projects for more details on the API client.
Source code
Source code for the @gadgetinc/api-client-core
package which contains all the utilities powering @gadget-client/blog
can be found on GitHub.