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

Cannot create custom Mutation or Subscription Adapter #89

Open
yargyropoulos opened this issue Dec 7, 2023 · 0 comments
Open

Cannot create custom Mutation or Subscription Adapter #89

yargyropoulos opened this issue Dec 7, 2023 · 0 comments

Comments

@yargyropoulos
Copy link

In index.ts, the type for a query adapter is any, while for the mutation or subscription adapters, they are limited to IMutationAdapter or ISubscriptionAdapter

function queryOperation(
  options: IQueryBuilderOptions | IQueryBuilderOptions[],
  adapter?: any,
  config?: any
)
...
function mutationOperation(
  options: IQueryBuilderOptions | IQueryBuilderOptions[],
  adapter?: IMutationAdapter,
  config?: any
) 
...
function subscriptionOperation(
  options: IQueryBuilderOptions | IQueryBuilderOptions[],
  adapter?: ISubscriptionAdapter
)

If I try to create my custom adapters, I will be able to create a Query Adapter without issues, but for a Mutation Adapter like this:

    const query = buildMutation({
        ...myOptions
    }, MyMutationAdapter);

I will get a compilation error like this: Type 'typeof MyMutationAdapter' is missing the following properties from type 'IMutationAdapter': mutationBuilder, mutationsBuilder , even though MyMutationAdapter implements both methods

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