Skip to content

feat(core): make MetaQuery and GraphQLQueryOptions interfaces to support declaration merging - #7530

Open
deepshekhardas wants to merge 1 commit into
refinedev:mainfrom
deepshekhardas:fix/7527-metaquery-interface
Open

feat(core): make MetaQuery and GraphQLQueryOptions interfaces to support declaration merging#7530
deepshekhardas wants to merge 1 commit into
refinedev:mainfrom
deepshekhardas:fix/7527-metaquery-interface

Conversation

@deepshekhardas

Copy link
Copy Markdown

Description

Converts MetaQuery and GraphQLQueryOptions from type aliases to interfaces so TypeScript declaration merging works. This lets consumers augment MetaQuery via declare module "@refinedev/core" to get full autocomplete and type-checking for custom meta properties (e.g. meta.queryParams) across every data hook (useTable, useShow, useList, ...).

Closes #7527.

Before

export type GraphQLQueryOptions = { ... };

export type MetaQuery = {
  [k: string]: any;
  queryContext?: Omit<QueryFunctionContext, "meta">;
} & QueryBuilderOptions & GraphQLQueryOptions;

After

export interface GraphQLQueryOptions { ... }

export interface MetaQuery extends QueryBuilderOptions, GraphQLQueryOptions {
  [k: string]: any;
  queryContext?: Omit<QueryFunctionContext, "meta">;
}

Structurally identical — fully backward compatible — but unlocks module augmentation:

declare module "@refinedev/core" {
  interface MetaQuery {
    queryParams?: { _pull?: string; _perPage?: number; [key: string]: unknown; };
  }
}

Changes

  • packages/core/src/contexts/data/types.ts: type → interface conversion
  • .changeset/metaquery-interface.md: changeset (minor)

@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3bcbc54

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@refinedev/core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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

Successfully merging this pull request may close these issues.

[FEAT] Make MetaQuery an interface to support declaration merging

1 participant