react-regional
v0.0.2
Published
graphql client for react
Downloads
1
Readme
react-regional
Intro
react-regional is GraphQL simple react client.
Installation
npm install react-reginal
Documents
- https://wheatandcat.github.io/react-regional/
Examples
import React from "react";
import { render } from "react-dom";
import { RegionalProvider, Query, gql } from "react-reginal";
var query = gql`
{
users {
id
name
}
}
`;
const Page = (({ users })) => (
<div>
{users.map((user, index) => (
<div key={index}>{user.name}</div>
))}
</div>
)
const App = () => (
<RegionalProvider uri="http://localhost:4466/">
<Query query={query}>
{result => {
if (result.loading) {
return null;
}
return <Page users={result.data.users} />;
}}
</Query>
</RegionalProvider>
)
render(<App />, document.getElementById("root"));