Last active
June 23, 2018 10:33
-
-
Save jjenzz/1ed649d3be9a59d262dc2d8bb06b9e58 to your computer and use it in GitHub Desktop.
I can't seem to figure out where I'm going wrong here. Querying `stats` returns `null` and the resolvers aren't called. Whyyyy? 🙈https://launchpad.graphql.com/w5q78w4zrz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const typeDefs = ` | |
schema { | |
query: Query | |
} | |
type Query { | |
stats: Stats | |
} | |
type Stats { | |
totalPlays: Int! | |
totalReleases: Int! | |
} | |
`; | |
module.exports.schema = makeExecutableSchema({ | |
typeDefs, | |
resolvers: { | |
Stats: { | |
totalPlays: () => fetch(/* ... */), | |
totalReleases: () => fetch(/* ... */), | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sods law. I ask for help and then figure it out: https://launchpad.graphql.com/4r70zwlvn9
That
Query
resolver seems so redundant but it works so I can sleep easy tonight 😅