Coder Social home page Coder Social logo

Comments (14)

janikvonrotz avatar janikvonrotz commented on June 16, 2024 1

Can you run the update branch of my demo app?

from meteor-apollo-accounts.

janikvonrotz avatar janikvonrotz commented on June 16, 2024

Before the update (works): https://github.com/janikvonrotz/meteor-apollo-accounts-example

And the branch after the update (fails): https://github.com/janikvonrotz/meteor-apollo-accounts-example/tree/update

from meteor-apollo-accounts.

janikvonrotz avatar janikvonrotz commented on June 16, 2024

Thanks for the update, however, it's not working for me yet:

Error: Mutation.createUser defined in resolvers, but not in schema

from meteor-apollo-accounts.

nicolaslopezj avatar nicolaslopezj commented on June 16, 2024

Remember that you have to install accounts-password

from meteor-apollo-accounts.

janikvonrotz avatar janikvonrotz commented on June 16, 2024

I did so. It seems that the hasService('password') check is not working for me. Could you run the the demo app from update branch and tell me if it works for you?

If I run this code server-side:

const Package = global.Package

console.log(!!Package['accounts-password'], Package['accounts-password'])

I'll get this output:

true {}

So I'm not sure why it fails to load the right graphql mutations.

from meteor-apollo-accounts.

janikvonrotz avatar janikvonrotz commented on June 16, 2024

Is the second gql tag necessary? It probably works without.

export default gql`
${
  hasService('password') ? gql`...

from meteor-apollo-accounts.

nicolaslopezj avatar nicolaslopezj commented on June 16, 2024

The tag doesn't do nothing, it's just for syntax highlighting on my editor.

What error are you having?

from meteor-apollo-accounts.

janikvonrotz avatar janikvonrotz commented on June 16, 2024

This mutations are not available:

  # Log the user in with a password.
  loginWithPassword (username: String, email: String, password: HashedPassword, plainPassword: String): LoginMethodResponse

  # Create a new user.
  createUser (username: String, email: String, password: HashedPassword!): LoginMethodResponse

  # Change the current user's password. Must be logged in.
  changePassword (oldPassword: HashedPassword!, newPassword: HashedPassword!): SuccessResponse

  # Request a forgot password email.
  forgotPassword (email: String!): SuccessResponse

  # Reset the password for a user using a token received in email. Logs the user in afterwards.
  resetPassword (newPassword: HashedPassword!, token: String!): LoginMethodResponse

And I think its because of this:

export default gql`
${
  hasService('password') ? >>gql<<`
  # Log the user in with a password.

Maybe it works without the graphql tag:

export default gql`
${
  hasService('password') ? `
  # Log the user in with a password.

from meteor-apollo-accounts.

nicolaslopezj avatar nicolaslopezj commented on June 16, 2024

Mmm I don't think it's the graphql tag, it works in my code. I believe that hasService('password') is returning false to you, but why? 🤔

from meteor-apollo-accounts.

janikvonrotz avatar janikvonrotz commented on June 16, 2024

I did a test: janikvonrotz/meteor-apollo-accounts-example@53aa06c

I've added the mutations from your packages directly into my schema. It only works without the gql tags. The plain text schema is taken as parameter for makeExecutableSchema. So it is not necessary to parse the graphql schema definitions with the gql tag.

I suppose you remove the gql tag in your schema definitions. This would also work according to the apollo documentation: http://dev.apollodata.com/tools/graphql-tools/generate-schema.html

Please let me know if this works for you.

from meteor-apollo-accounts.

nicolaslopezj avatar nicolaslopezj commented on June 16, 2024

This is the gql tag I'm using https://github.com/nicolaslopezj/meteor-apollo-accounts/blob/master/apollo-accounts/src/gql.js, not the package "graphql-tag". It doesn't do anything.

The error must be somewhere else 🤔

from meteor-apollo-accounts.

janikvonrotz avatar janikvonrotz commented on June 16, 2024

But why use a parser at all?

from meteor-apollo-accounts.

nicolaslopezj avatar nicolaslopezj commented on June 16, 2024

Now it's fixed, just by adding accounts-password to the weak dependencies of this package.

from meteor-apollo-accounts.

nicolaslopezj avatar nicolaslopezj commented on June 16, 2024

Thanks a lot for testing and making the example

from meteor-apollo-accounts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.