graphql icon indicating copy to clipboard operation
graphql copied to clipboard

Is it possible to make this work with graphql-compose?

Open MetaCorp opened this issue 8 years ago • 2 comments

Hey, I've been trying to use accounts-js with graphql-compose but can't find a way to make it work. Can you guys give me an example, or some advice?

MetaCorp avatar Dec 02 '17 15:12 MetaCorp

Hey @MetaCorp!

Thanks for taking interest in this project! I am not familiar with graphql-compose.

Could you explain what it deos and how exactly you would like to use accounts-js?

Currently the @accoutns/graphql-api package will expose a class that extends a schema using makeExecutableSchema from graphql-tools. There is an example in the readme file of the graphql-api package.

Let me know how it goes!

davidyaha avatar Dec 02 '17 18:12 davidyaha

I would like to use accounts-js to have an authentification with password at first, to make some data only accessible for connected client.

graphql-compose can generate graphql resolvers from schemas, I've been testing it recently and really enjoyed that lib, and it comes with great plugins. I'm using graphql-compose-mongoose to generate resolvers from mongoose schemas.

I found a way to extend graphql-compose resolvers using mergeSchemas() from graphql-tools. This example from graphql-compose.

So i have access to account-js resolvers but they throw errors. When trying with createUser I have this: GraphQLError: Cannot read property 'emit' of undefined.

I'm doing my testing on this repo. Maybe you can help me here.

MetaCorp avatar Dec 03 '17 14:12 MetaCorp