Skip to content

Instantly share code, notes, and snippets.

@kettanaito
Created March 18, 2020 10:36
Show Gist options
  • Save kettanaito/5a5a7d879150026bdd50bbd94aa91852 to your computer and use it in GitHub Desktop.
Save kettanaito/5a5a7d879150026bdd50bbd94aa91852 to your computer and use it in GitHub Desktop.
Gatsby custom field resolver
// 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