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

CosmosDataSource requires Context now? #73

Closed
diberry opened this issue Aug 12, 2022 · 2 comments
Closed

CosmosDataSource requires Context now? #73

diberry opened this issue Aug 12, 2022 · 2 comments

Comments

@diberry
Copy link

diberry commented Aug 12, 2022

Can you update the sample code to explain where the ApolloContext is from (package) and how it is created?

export class UserDataSource extends CosmosDataSource<UserDoc, ApolloContext> {}

I'm updating from 0.0.14 where it wasn't required to 0.1.0 where it seems to be required.

@diberry
Copy link
Author

diberry commented Aug 12, 2022

Ok, here is what I did to get past the Type Error but honestly not sure why the ApolloContext is listed in the docs and then why I don't really need it.

Changed

export class GameDataSource
  extends CosmosDataSource<GameModel, ApolloContext>
  implements IGameDataSource
{

to

export class GameDataSource
  extends CosmosDataSource<GameModel, any>
  implements IGameDataSource
{

@andrejpk
Copy link
Owner

andrejpk commented Mar 6, 2024

sorry missed the notifications and got behind here.

The context is a type parameter so you can use an enriched type for ApolloContext. I'll add something to the docs on this.

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