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 }) => (
|
||||||
scoutID: ownProps.scoutID,
|
data.getScout ? {
|
||||||
displayName: data.getScout.displayName,
|
scoutID: ownProps.scoutID,
|
||||||
completedAdventures: data.getScout.adventures,
|
displayName: data.getScout.displayName,
|
||||||
completedAchievements: data.getScout.achievements,
|
completedAdventures: data.getScout.adventures,
|
||||||
advancementDeadline: data.getScout.advancementDeadline
|
completedAchievements: data.getScout.achievements,
|
||||||
|
advancementDeadline: data.getScout.advancementDeadline
|
||||||
|
} : {
|
||||||
|
scoutID: ownProps.scoutID
|
||||||
|
}
|
||||||
|
)
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue