Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tqwewe/solid-urql
Urql support for Solid JS projects.
https://github.com/tqwewe/solid-urql
Last synced: about 2 months ago
JSON representation
Urql support for Solid JS projects.
- Host: GitHub
- URL: https://github.com/tqwewe/solid-urql
- Owner: tqwewe
- License: mit
- Created: 2021-07-04T10:26:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-31T12:57:22.000Z (over 2 years ago)
- Last Synced: 2024-05-21T13:53:32.843Z (7 months ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/solid-urql
- Size: 32.2 KB
- Stars: 35
- Watchers: 1
- Forks: 4
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-solid-js - Solid URQL
README
Solid URQL
URQL support for Solid JS projects.
## Installation
```bash
yarn add solid-urql @urql/core graphql
# or
npm i solid-urql @urql/core graphql
```## Usage
```tsx
import { createClient, Provider } from 'solid-urql'const client = createClient({
url: 'http://localhost:8000/graphql',
})const App = (props) => {
return (
)
}
``````tsx
import { Show } from 'solid-js'
import { createQuery } from 'solid-urql'const TodosQuery = `
query {
todos {
id
title
}
}
`const TodoList = (props) => {
const [items, itemsState, reexecuteQuery] = createQuery({
query: TodosQuery,
})return (
Loading...}>
Items are:{' '}
{items()
.map((item) => item.title)
.join(', ')}
)
}
```Read more at the [URQL Official Documentation](https://formidable.com/open-source/urql/).
## Contributing 🙌
Contributions are more than welcome. If you see any changes fit, go ahead and open an issue or PR.
---
Any support is a huge motivation, thank you very much!