Comments (3)
You're right. I figured out how I got to this issue. I'm using the GraphiQL application to hit localhost:3000/graphql_auth and it was just hanging/spinning (which should be the issue you'd be concerned with) and figured that this was related. I do have an execute
action though:
class GraphqlController < ApplicationController
# If accessing from outside this domain, nullify the session
# This allows for outside API access while preventing CSRF attacks,
# but you'll have to authenticate your user separately
protect_from_forgery with: :null_session
def execute
variables = ensure_hash(params[:variables])
query = params[:query]
operation_name = params[:operationName]
context = {
# Query context goes here, for example:
# current_user: current_user,
}
result = JwtRailsExampleSchema.execute(query, variables: variables, context: context, operation_name: operation_name)
render json: result
rescue => e
raise e unless Rails.env.development?
handle_error_in_development e
end
...
end
My graphql_auth
route is working now for some reason so I'll have to figure out what else is going on with my project. Thanks!
from graphql_devise.
Hey @aarona looks like this might be unrelated to the gem. As you can see on your routes output, the gem uses the auth
action on our own graphql_devise/graphql controller. How you mount your own graphql schema is a different story. For that, you should follow the graphql gem instructions and run the generator in your app. Looks like your own personal graphql controller is missing the action execute which should process que request using your own graphql schema. Look how the dummy app does it in the routes and controller
from graphql_devise.
Ok after some research it looks like its because I'm using the create-repack-app which creates an API only rails app. This line in execute
:
protect_from_forgery with: :null_session
is causing the problem. Are you guys using API only rails apps when testing? I wonder what I should do about this? I think I can just delete that line if I use CORS and graphql_devise for authentication, right?
from graphql_devise.
Related Issues (20)
- GraphQL::Schema::DuplicateNamesError HOT 5
- how to set current_resource for both authenticated and unauthenticated fields HOT 1
- Support for ruby-graphql v2 HOT 3
- A class must be provided when mounting a model. String values are no longer supported HOT 3
- Mount only necessary operations in existing schema. HOT 3
- Authenticate non-root fields HOT 6
- Cannot make it work with Mongoid HOT 5
- `context[:controller]` is nil when trying to login HOT 1
- Scoping auth tokens to more than one model HOT 1
- If expiry was in epoch seconds, it may be out of the range of INT. HOT 1
- Disable introspection HOT 1
- Support graphql v2.1 HOT 4
- NoMethodError: undefined method `resource=' for nil:NilClass HOT 5
- Add ability to customize raise_user_error_list and raise_user_error_list
- Add ability to customize raise_user_error_list method HOT 11
- Unable to set my message from #inactive_message method HOT 7
- NoMethodError: undefined method `case_insensitive_keys' for nil:NilClass HOT 5
- Is there a way to use the default devise template views? HOT 1
- Uninitialized constant `GraphqlDevise::SchemaPlugin` After trying to mount `graphql_devise` in my schema HOT 5
- Schema.tracer Deprecation Warning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql_devise.