Renamed GraphQL route, added support for GET requests

This commit is contained in:
Alberto Miedes Garcés
2016-11-22 15:22:27 +01:00
parent 7bb1778124
commit 2271f6d634
2 changed files with 4 additions and 4 deletions

View File

@@ -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"

View File

@@ -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