8000 [REQUEST] support vercel edge functions by default · Issue #341 · graphql/dataloader · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[REQUEST] support vercel edge functions by default #341
Open
@sgrund14

Description

@sgrund14

What problem are you trying to solve?

support the vercel edge runtime for dataloaders without workaround. see discussion here vercel/next.js#44711 (edge does not support process.nextTick, which is being checked in the Dataloader package)

right now, you have to pass in the batchScheduleFn with a setTimeout to the DataLoader to make the package work on the edge runtime like so

 batchScheduleFn: (cb) => setTimeout(cb, 0),

but this might not be ideal? not totally sure what happens in this case, I would just worry about adding latency or breaking the batching with the setTimeout instead of relying on the default behavior (batching per execution context)

Describe the solution you'd like

Dataloader should work in the edge runtime without having to pass in a setTimeout

Describe alternatives you've considered

using the setTimeout workaround

Additional context

nice to support edge functions so that you can have zero cold start graphql functions in a serverless environment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0