Skip to content

[v3] Filter out nulls in response interceptor #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v3-dev
Choose a base branch
from

Conversation

JustWalters
Copy link
Contributor

@JustWalters JustWalters commented Apr 21, 2025

Calls to storage where the field doesn't exist return an array with a single null element. That throws an error when trying to access .type
Most (this is an assumption, but the several I've tested) routes return a 404 when there's no data so we never get to data loader.

Other v3 changes can include:

  • Updating typescript (and other packages)
  • EnvoyJWT.encode should accept more specific types
  • Update target lib in TS config

Calls to storage where the field doesn't exist return an array
with a single null element. That throws an error when trying
to access .type
@@ -74,6 +74,7 @@ export default class EnvoyAPI {

(included || [])
.concat(modelOrModels)
.filter((model: JSONAPIData | null) => model !== null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the return type of storage method(s).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also affects delete (at least for sign-in-fields).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant