Graphql-ruby: NameError (uninitialized constant Types::AuthProviderEmailInput):

Created on 20 Oct 2018  路  3Comments  路  Source: rmosolgo/graphql-ruby

I am following the tutorial from https://www.howtographql.com/graphql-ruby/4-authentication/
I get the following error while trying to create a mutation to create new Users;

NameError (uninitialized constant Types::AuthProviderEmailInput):
app/graphql/resolvers/create_user.rb:5:in `block in <class:CreateUser>'
app/graphql/graph_ql_ruby_schema.rb:1:in `<top (required)>'app/controllers/graphql_controller.rb:10:in `execute'

Most helpful comment

@EAdeveloper Please correct the file name to be auth_provider_email_input.rb

in ..app/graphql/types/auth_provider_email_input.rb

Types::AuthProviderEmailInput = GraphQL::InputObjectType.define do
  name 'AUTH_PROVIDER_EMAIL'

  argument :email, !types.String
  argument :password, !types.String
end

All 3 comments

@EAdeveloper Please correct the file name to be auth_provider_email_input.rb

in ..app/graphql/types/auth_provider_email_input.rb

Types::AuthProviderEmailInput = GraphQL::InputObjectType.define do
  name 'AUTH_PROVIDER_EMAIL'

  argument :email, !types.String
  argument :password, !types.String
end

Hi! I hoped that helped for you. Sorry, I don't know that tutorial so I can't support it here. You might try the howtographql repository instead: https://github.com/howtographql/howtographql

hello can you please explain why !types.String no more work , when i made this commande "rails g graphql:object user title:string etc" it generate file with Types::StringType instead of !types.String
thank you :)

Was this page helpful?
0 / 5 - 0 ratings