-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Questions
Do you have examples of someone using OneGraph with @apollo/react-hooks?
My Attempt:
I am attempting to add caching in this draft PR: bdougie/open-sauced#379.
@apollo/react-hooks
apollo-cache-inmemory
import {useApolloClient, useQuery} from "@apollo/react-hooks";
import {gql} from "apollo-boost";
const fetchGoalsQuery = gql`
query FetchGoals($name: String!) {
gitHub {
viewer {
repository(name: $name) {
id
issues(first: 10, states: OPEN, orderBy: {direction: DESC, field: CREATED_AT}) {
totalCount
nodes {
id
title
body
number
labels(first: 3) {
nodes {
color
name
id
}
}
}
}
}
}
}
}
`;
// useQuery succeeds but the data and error returns undefined.
const {data, error} = useQuery(fetchGoalsQuery, {name: "open-sauced-goals"});
// data and error are undefined
console.log("error", error);
console.log("data", data);Metadata
Metadata
Assignees
Labels
No labels