Comments (3)
Hi @jthegedus
Currently, I only plan to implement graphql-rbac
at our next release, but I did think about malicious queries protection before.
Since most of them are apollo schema directives, I could probably open up an API for schema directives. If it's not, we can still transform it into graphql middleware.
I'll think about it more. I'll see If it's sth I can implement with graphql-rbac
and come up with a general API.
Thanks!
from gqlify.
I think opening up the API to allow users to specify their own directives and 3rd part tools would be ideal.
Just as a side note, it would be good to get some examples in the docs that demonstrate how people can use their existing Apollo Configs with gqlify
. Currently I'm doing this:
new Gqlify({
// provide datamodel to gqlify
sdl,
// provide data-sources map to GQLify,
// so GQLify would know how to create data-source for each model
dataSources: {
firestore: args => new FirestoreDataSource({ collection: args.key }),
},
skipPrint: true,
})
...
function createApolloConfig() {
return {
introspection: true,
playground: true,
onHealthCheck: () =>
new Promise((resolve, reject) => {
// check your downstream services for health status
// this could be internal or external dbs etc
console.info("checking health");
resolve();
}),
formatError: error => {
console.error(error); // log the error in the Cloud Function logs
return new Error("Internal server error"); // mask the error returned to the frontend
},
};
}
...
async function createGQLServer() {
const app = express();
// GQLify will provide GraphQL apis & resolvers to apollo-server
const gqlify = await createGqlify();
const gqlifyApolloConfig = gqlify.createApolloConfig();
const apolloConfig = createApolloConfig();
const finalServerConfig = {
...gqlifyApolloConfig,
...apolloConfig,
};
const server = new ApolloServer(finalServerConfig);
...
from gqlify.
Hi @wwwy3y3, is there any progress or roadmap we can see for these types of features? Happy to help contribute where I can
from gqlify.
Related Issues (20)
- Atomic operation on nested array in GraphQL API
- Support firestore.FieldValue.serverTimestamp()
- Encapsulate payload in update passed to dataSource HOT 1
- Latest graphql causes error HOT 3
- I can't seem to find the docs to contribute HOT 2
- use @gqlify/firestore without cert & dbUrl HOT 2
- implement apollo-server-lambda with MongoDataSource HOT 6
- Support Firestore sub-collections HOT 5
- Support changing the payload when updating.
- Support more operators
- Datamodel types without scalar fields break GQLify generation
- @unique dosen't work when I use it in another attibut
- Give it a new future HOT 1
- .
- TypeError: Cannot set property 'PageInfo' of undefined HOT 5
- latest graphql causes error again! HOT 1
- Data model relationship generation
- How to make a many-to-many relation in default data for memory datasource
- Project status?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gqlify.