Created
April 4, 2022 11:37
-
-
Save TimBroddin/caeaa7a9c8dff11c707183068030ebdf to your computer and use it in GitHub Desktop.
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 CopyrightPlugin = { | |
requestDidStart(requestContext) { | |
return { | |
willSendResponse(context) { | |
context.response.extensions = { | |
...context.response.extensions, | |
copyright: | |
"All data returned by this API is copyrighted by Wannabes and the respective photographer(s).", | |
}; | |
}, | |
}; | |
}, | |
}; | |
const server = new ApolloServer({ | |
...createSchema(db), | |
debug: false, | |
engine: { reportSchema: true }, | |
cors: true, | |
playground: true, | |
introspection: true, | |
tracing: true, | |
plugins: [CopyrightPlugin], | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment