Renamed GraphQL route, added support for GET requests
This commit is contained in:
@@ -263,9 +263,9 @@ Rails.application.routes.draw do
|
||||
end
|
||||
|
||||
# GraphQL
|
||||
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/queries"
|
||||
post '/queries', to: 'graphql#query'
|
||||
|
||||
mount GraphiQL::Rails::Engine, at: '/graphiql', graphql_path: '/graphql'
|
||||
get '/graphql', to: 'graphql#query'
|
||||
post '/graphql', to: 'graphql#query'
|
||||
|
||||
if Rails.env.development?
|
||||
mount LetterOpenerWeb::Engine, at: "/letter_opener"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require 'rails_helper'
|
||||
|
||||
describe GraphqlController do
|
||||
let!(:uri) { URI::HTTP.build(host: 'localhost', path: '/queries', port: 3000) }
|
||||
let!(:uri) { URI::HTTP.build(host: 'localhost', path: '/graphql', port: 3000) }
|
||||
|
||||
describe "GET request" do
|
||||
it "is accepted when valid" do
|
||||
|
||||
Reference in New Issue
Block a user