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

Add ability to refetch a query in useQuery and useQueryWithStore #6130

Merged
merged 8 commits into from
Apr 13, 2021

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Apr 6, 2021

No description provided.

@djhi djhi added the RFR Ready For Review label Apr 6, 2021
@djhi djhi added this to the 3.15 milestone Apr 6, 2021
@djhi djhi changed the base branch from master to next April 6, 2021 13:45
Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward to reading the documention!

packages/ra-core/src/dataProvider/useQuery.ts Outdated Show resolved Hide resolved
docs/Actions.md Outdated Show resolved Hide resolved
docs/Actions.md Outdated Show resolved Hide resolved
loading: boolean;
loaded: boolean;
} => {
): StateResult => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to UseQueryWithStoreValue

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be a breaking change, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? The type wasn't named or exported before this PR.

djhi and others added 3 commits April 7, 2021 08:49
Co-authored-by: Francois Zaninotto <francois@marmelab.com>
UseQueryValue,
UseGetOneHookValue,
};
export * from './useQueryWithStore';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work: the Query type will conflict with the Query component.

The Query type name is too generic; Something like DataProviderQuery would be better, WDYT?

resource?: string;
payload: object;
}

export interface QueryOptions {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be named UseQueryOptions. Sorry to find the problems one by one, but the fact that you decided to expose all exports in this file created new problems

@fzaninotto fzaninotto changed the title Implement refetch in useQuery and useQueryWithStore Add ability to refetch a query in useQuery and useQueryWithStore Apr 13, 2021
@fzaninotto fzaninotto merged commit f1e47f7 into next Apr 13, 2021
@fzaninotto fzaninotto deleted the use-query-refetch branch April 13, 2021 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants