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

feat: useAsyncGql data fetching #153

Merged
merged 2 commits into from Aug 9, 2022
Merged

feat: useAsyncGql data fetching #153

merged 2 commits into from Aug 9, 2022

Conversation

Diizzayy
Copy link
Owner

@Diizzayy Diizzayy commented Aug 8, 2022

This PR introduces a new composable useAsyncGql which leverages useAsyncData under the hood.

Before:

const { data } = await useAsyncData('<data-key>', () => GqlLaunches({ limit: 5 }))

After:

const { data } = await useAsyncGql('launches', { limit: 5 });
const { data } = await useAsyncGql({
  operation: 'launches',
  variables: { limit: 5 }
});

@Diizzayy Diizzayy added the enhancement New feature or request label Aug 8, 2022
@Diizzayy Diizzayy self-assigned this Aug 8, 2022
@Diizzayy Diizzayy merged commit dfb0ae4 into main Aug 9, 2022
@Diizzayy Diizzayy deleted the feat/use-async-gql branch August 9, 2022 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant