inngest / inngest-js

The developer platform for easily building reliable workflows with zero infrastructure for TypeScript & JavaScript
https://www.inngest.com/
GNU General Public License v3.0
440 stars 43 forks source link

Fix `data` not being required during invocation with a schema+reference #463

Closed jpwilliams closed 10 months ago

jpwilliams commented 10 months ago

Summary

When using referenceFunction() to invoke, data was never required, even if the referenced function had a data schema.

This call should (and does following this PR) throw a TS error as it is lacking data:

invoke("id", {
  function: referenceFunction({
    functionId: "fn",
    schemas: {
      data: z.object({ wowza: z.string() }),
    },
  }),
});

Checklist

changeset-bot[bot] commented 10 months ago

🦋 Changeset detected

Latest commit: eb8d1ca902f9b6eaa2b9a3251a2dc3301f4ddc31

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------- | ----- | | inngest | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR