Created
March 18, 2020 10:36
-
-
Save kettanaito/5a5a7d879150026bdd50bbd94aa91852 to your computer and use it in GitHub Desktop.
Gatsby custom field resolver
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
// Importing this fails, as the plugin is distributed in modern module format | |
// and `gatsby-config.js` is not transpiled. | |
const firebase = require('gatsby-plugin-firebase') | |
exports.createResolvers = ({ createResolvers }) => { | |
const resolvers = { | |
Query: { | |
customField: { | |
type: 'String', | |
resolve() { | |
firebase.database().and.so.on() | |
} | |
} | |
} | |
} | |
createResolvers(resolvers) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment