Skip to content
This repository has been archived by the owner on Jul 5, 2018. It is now read-only.

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

Open
MetaCorp opened this issue Dec 2, 2017 · 2 comments
Open

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

MetaCorp opened this issue Dec 2, 2017 · 2 comments

Comments

@MetaCorp
Copy link

MetaCorp commented Dec 2, 2017

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?

@davidyaha
Copy link
Member

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!

@MetaCorp
Copy link
Author

MetaCorp commented Dec 3, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants