Skip to content
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

__resolveReference in Typescript Loader #932

Open
timclaason opened this issue Dec 12, 2022 · 1 comment
Open

__resolveReference in Typescript Loader #932

timclaason opened this issue Dec 12, 2022 · 1 comment

Comments

@timclaason
Copy link

timclaason commented Dec 12, 2022

Wondering if there is a Typescript equivalent of the Javascript example given in documentation for how to have a cached reference resolver in a loader. For some reason, I can't get it to work...

const loaders = {
  User: {
    async __resolveReference(queries, context) {
      // This should be a bulk query to the database
      return queries.map(({ obj }) => users[obj.id])
    }
  }
}
@mcollina
Copy link
Collaborator

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

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

No branches or pull requests

2 participants