Skip to content

Commit

Permalink
chore: add usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
BatuhanW committed Sep 12, 2023
1 parent 125ca98 commit 75f42b5
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions .changeset/popular-walls-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,39 @@ feat: initialize nestjs-query-graphql package.

🎉🎉🎉 This is the initial release of our nestjs-query-graphql data provider. https://tripss.github.io/nestjs-query 🎉🎉🎉

Supported features: - filters ✅ - sorters ✅ - pagination ✅ - offset connections ✅ - subscriptions ✅
Supported features:

Not supported features: - relay connections ❌
- filters ✅
- sorters ✅
- offset pagination ✅
- offset connections ✅
- subscriptions ✅

Usage example:

```tsx
import graphqlDataProvider, {
GraphQLClient,
liveProvider,
} from "@refinedev/nestjs-query-graphql";

import { createClient } from "graphql-ws";

const API_URL = `https://api.nestjs-query.refine.dev/graphql`;

const WS_URL = `wss://api.nestjs-query.refine.dev/graphql`;

const client = new GraphQLClient(API_URL);

const wsClient = createClient(WS_URL);

export const dataProvider = graphqlDataProvider(client);

export const liveProvider = liveProdiver(wsClient);

export const App = () => (
<Refine dataProvider={dataProvider} liveProvider={liveProvider}>
//...
</Refine>
);
```

0 comments on commit 75f42b5

Please sign in to comment.