Prisma 1 Forum

Issue with "email-password" module and merging

Update: Check 4th post for source of issue. The email-password module fails silently when being added.

From reading the new documentation (love the new format by the way), it seems like added modules should have the types.graphql merged when running graphcool deploy. Currently I always get the message identical project definitions until I copy and paste the types directly from the modules into the types.graphql in my root folder. If I move into the modlues folder, the new files are recognized but without a .graphcoolrc file it can’t push even when supplied the environment directly.

Still trying to figure out how modules fit into the picture, so sorry if some of these next few questions are basic. Is the project.graphcool file no longer necessary after ejecting? It seems like the .graphcoolrc and types.graphql file have now taken its place. Also concerning the javascript files bundled with the modules, those are just for example purposes correct? So if I were to implement modules in a React or Vue application, I wouldn’t need to worry about these files outside of using them as inspiration for mutations and things?

Thanks for help with the basic questions, and hopefully someone can help me see what I’m doing wrong when it comes to modules not “merging”.

Update: Look to bottom post. This wasn’t the real issue/ solution.

In order to properly “merge” types.graphql, the graphcool project needs its own folder with the project definitions inside of it. Inside of this folder, the modules are installed and must be added with the graphcool folder as the root. Not the src folder (though this will add the actual folder to your directory it doesn’t seem to be recognized when merging). Furthermore if you get the error Cannot read property 'endPosition' of undefined when trying to add modules, it is known and can be fixed by adding modules: facebook: modules/facebook/graphcool.yml to the graphcool.yml in the main graphcool directory. After this files properly merge.

In addition, in response to you earlier question about the javascript files in the modules. They are not example files, but rather the function code for the server-side resolvers, hooks and subscriptions. They contain the actual implementation of the functionality that a module offers.
As they are meant to be used on the server-side (within Graphcool, or incidentally, an external webtask), they are of no concern to your client-side development.

Thanks for making that clear @agartha.

As for the source of my issue the last 4 days, I think I finally found the issue actually has to do with the email-password module. When the email-password module is added when another module already exists, it fails silently saying something like identical project definitions and just refuses to merge. If however I create a completely new project and add the email-password module, it fails immediately with:

[ERROR in module: email-password] Errors while validating graphcool.yml:

 ▸      data.functions['signup'].handler.code should be object
 ▸      data.functions['signup'].handler.code should match exactly one schema in oneOf
 ▸      data.functions['signup'].handler should NOT have additional properties
 ▸      data.functions['signup'].handler should match exactly one schema in oneOf

@nilan have you seen anyone else with this issue? Seems like the source of all my confusion the past few days. Was only able to get anywhere when this module wasn’t added, and I assumed I just did something wrong the first time and tried to document my process with that write up.

I do get a warning that There is a .graphcoolrc file in your home directory from the old CLI, but there doesn’t appear to be when I go to delete it. Maybe that is contributing to the problem?

Hey, there definitely seems that something fishy is going on with the email-password module :thinking:

First, could you try this:

npm remove -g graphcool
npm install -g graphcool@beta

And try to reproduce the problems? What is the step by step instructions for reproductions?
I’m having a hard time to decide whether the problem lies in the module or the CLI, and this will help me with that :slight_smile:

Side note, we’re rowing back a bit on the modules concept, it will probably be replaced by the more lightweight templates. Here’s the proposal:

Hi @nilan, sorry to get back a little late. I’ve removed and reinstalled the beta, as well as made sure to remove it from yarn in case of an old version there. Still the same issue.

In new empty project:

  1. graphcool init
  2. graphcool modules add graphcool/modules/authentication/email-password
  3. graphcool deploy This step has the error

When I use the facebook module, everything merges as expected. Please let me know if you aren’t able to reproduce this and I’ll try to see what could be different about my setup.

I too need help in this regards as Someone in my contact list sends messages asking for cash to individuals. They put in the spam filter the contact’s messages, so the answers go to spam. I haven’t clicked on any email links, so I don’t know how they keep getting the password. Someone was talking about a bot. I also ran malware bytes and SUPERAntiSpyware, but only non-critical adware turned up. Any suggestions about my next move to Recover Forgot AOL Password?

Thank you in advance!