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";
|
||||
|
||||
export default ScoutOverview = (
|
||||
{scoutID,
|
||||
export default ({
|
||||
scoutID,
|
||||
displayName,
|
||||
advancementDeadline,
|
||||
completedAdventures,
|
||||
completedAchievements}
|
||||
) => {
|
||||
console.log(data);
|
||||
completedAchievements
|
||||
}) => {
|
||||
console.log(displayName)
|
||||
return (
|
||||
<div>
|
||||
{displayName}
|
||||
|
|
|
@ -6,16 +6,33 @@ export default graphql(gql`
|
|||
getScout(id: $scoutID){
|
||||
displayName,
|
||||
advancementDeadline,
|
||||
adventures,
|
||||
acheivments,
|
||||
adventures {
|
||||
edges {
|
||||
node {
|
||||
name
|
||||
}
|
||||
}
|
||||
},
|
||||
achievements {
|
||||
edges {
|
||||
node {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`,{
|
||||
options : ({scoutID}) => ({variables: {scoutID}}),
|
||||
props: ({ ownProps, data }) => {
|
||||
scoutID: ownProps.scoutID,
|
||||
displayName: data.getScout.displayName,
|
||||
completedAdventures: data.getScout.adventures,
|
||||
completedAchievements: data.getScout.achievements,
|
||||
advancementDeadline: data.getScout.advancementDeadline
|
||||
props: ({ ownProps, data }) => (
|
||||
data.getScout ? {
|
||||
scoutID: ownProps.scoutID,
|
||||
displayName: data.getScout.displayName,
|
||||
completedAdventures: data.getScout.adventures,
|
||||
completedAchievements: data.getScout.achievements,
|
||||
advancementDeadline: data.getScout.advancementDeadline
|
||||
} : {
|
||||
scoutID: ownProps.scoutID
|
||||
}
|
||||
)
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue