Added connection lists to scout query
This commit is contained in:
parent
c8d37bab15
commit
aa8953ca1a
2 changed files with 30 additions and 13 deletions
|
@ -1,13 +1,13 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default ScoutOverview = (
|
export default ({
|
||||||
{scoutID,
|
scoutID,
|
||||||
displayName,
|
displayName,
|
||||||
advancementDeadline,
|
advancementDeadline,
|
||||||
completedAdventures,
|
completedAdventures,
|
||||||
completedAchievements}
|
completedAchievements
|
||||||
) => {
|
}) => {
|
||||||
console.log(data);
|
console.log(displayName)
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{displayName}
|
{displayName}
|
||||||
|
|
|
@ -6,16 +6,33 @@ export default graphql(gql`
|
||||||
getScout(id: $scoutID){
|
getScout(id: $scoutID){
|
||||||
displayName,
|
displayName,
|
||||||
advancementDeadline,
|
advancementDeadline,
|
||||||
adventures,
|
adventures {
|
||||||
acheivments,
|
edges {
|
||||||
|
node {
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
achievements {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,{
|
`,{
|
||||||
options : ({scoutID}) => ({variables: {scoutID}}),
|
options : ({scoutID}) => ({variables: {scoutID}}),
|
||||||
props: ({ ownProps, data }) => {
|
props: ({ ownProps, data }) => (
|
||||||
|
data.getScout ? {
|
||||||
scoutID: ownProps.scoutID,
|
scoutID: ownProps.scoutID,
|
||||||
displayName: data.getScout.displayName,
|
displayName: data.getScout.displayName,
|
||||||
completedAdventures: data.getScout.adventures,
|
completedAdventures: data.getScout.adventures,
|
||||||
completedAchievements: data.getScout.achievements,
|
completedAchievements: data.getScout.achievements,
|
||||||
advancementDeadline: data.getScout.advancementDeadline
|
advancementDeadline: data.getScout.advancementDeadline
|
||||||
|
} : {
|
||||||
|
scoutID: ownProps.scoutID
|
||||||
|
}
|
||||||
|
)
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue