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

Example with a database and graphql #89

Open
ViniciusAtaide opened this issue Jun 19, 2022 · 3 comments
Open

Example with a database and graphql #89

ViniciusAtaide opened this issue Jun 19, 2022 · 3 comments

Comments

@ViniciusAtaide
Copy link

could you provide a simple example with any database using the IN clause?

I'm new to dataloader so I'm mostly deducing keys are each id that the resolver provides but I'm not sure.

Thank you

@ViniciusAtaide
Copy link
Author

ViniciusAtaide commented Jun 19, 2022

The returned value from the conversion from the database too would be nice to understand. I see a for casting one type to another but idk if the mapped result with a repository with id as keys and entities as values are an obligatory approach.

@ViniciusAtaide
Copy link
Author

ViniciusAtaide commented Jun 19, 2022

taking advantage of the thread may I ask too why in my application it is asking 5 as a string in this codeline

result, err := loader.Load(context.Background(), 5)()

@ViniciusAtaide ViniciusAtaide changed the title example with a database Example with a database and graphql Jun 19, 2022
@ViniciusAtaide
Copy link
Author

taking advantage of the thread may I ask too why in my application it is asking 5 as a string in this codeline

result, err := loader.Load(context.Background(), 5)()

just found out that was the same type of my key, uuid. that's why

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

1 participant