Renamed GraphQL route, added support for GET requests
This commit is contained in:
@@ -263,9 +263,9 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
|
|
||||||
# GraphQL
|
# GraphQL
|
||||||
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/queries"
|
mount GraphiQL::Rails::Engine, at: '/graphiql', graphql_path: '/graphql'
|
||||||
post '/queries', to: 'graphql#query'
|
get '/graphql', to: 'graphql#query'
|
||||||
|
post '/graphql', to: 'graphql#query'
|
||||||
|
|
||||||
if Rails.env.development?
|
if Rails.env.development?
|
||||||
mount LetterOpenerWeb::Engine, at: "/letter_opener"
|
mount LetterOpenerWeb::Engine, at: "/letter_opener"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe GraphqlController do
|
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
|
describe "GET request" do
|
||||||
it "is accepted when valid" do
|
it "is accepted when valid" do
|
||||||
|
|||||||
Reference in New Issue
Block a user