Merge pull request #5025 from tchak/use-graphql-playground

Use graphql playground instead of graphiql
This commit is contained in:
Paul Chavard 2020-04-09 19:59:16 +02:00 committed by GitHub
commit c5882a8b22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 87 deletions

View file

@ -31,10 +31,10 @@ gem 'flipper-ui'
gem 'fugit'
gem 'geocoder'
gem 'gon'
gem 'graphiql-rails'
gem 'graphql'
gem 'graphql-batch'
gem 'graphql-rails_logger'
gem 'graphql_playground-rails'
gem 'groupdate'
gem 'haml-rails'
gem 'hashie'

View file

@ -248,9 +248,6 @@ GEM
i18n (>= 0.7)
multi_json
request_store (>= 1.0)
graphiql-rails (1.7.0)
railties
sprockets-rails
graphql (1.10.6)
graphql-batch (0.4.2)
graphql (>= 1.3, < 2)
@ -264,6 +261,8 @@ GEM
bundler (>= 1.14)
graphql (~> 1.10)
thor (>= 0.19, < 2.0)
graphql_playground-rails (2.1.0)
rails (>= 5.1.0)
groupdate (5.0.0)
activesupport (>= 5)
guard (2.15.0)
@ -755,11 +754,11 @@ DEPENDENCIES
fugit
geocoder
gon
graphiql-rails
graphql
graphql-batch
graphql-rails_logger
graphql-schema_comparator
graphql_playground-rails
groupdate
guard
guard-livereload

View file

@ -1,81 +0,0 @@
DEFAULT_QUERY = "# La documentation officielle de la spécification (Anglais) : https://graphql.org/
# Une introduction aux concepts et raisons d'être de GraphQL (Français) : https://blog.octo.com/graphql-et-pourquoi-faire/
# Le schema GraphQL de demarches-simplifiees.fr : https://demarches-simplifiees-graphql.netlify.com
# Le endpoint GraphQL de demarches-simplifiees.fr : https://www.demarches-simplifiees.fr/api/v2/graphql
query getDemarche($demarcheNumber: Int!) {
demarche(number: $demarcheNumber) {
id
number
title
champDescriptors {
id
type
label
}
dossiers(first: 3) {
nodes {
id
number
datePassageEnConstruction
datePassageEnInstruction
dateTraitement
usager {
email
}
champs {
id
label
... on TextChamp {
value
}
... on DecimalNumberChamp {
value
}
... on IntegerNumberChamp {
value
}
... on CheckboxChamp {
value
}
... on DateChamp {
value
}
... on DossierLinkChamp {
dossier {
id
}
}
... on MultipleDropDownListChamp {
values
}
... on LinkedDropDownListChamp {
primaryValue
secondaryValue
}
... on PieceJustificativeChamp {
file {
url
}
}
... on CarteChamp {
geoAreas {
source
geometry {
type
coordinates
}
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}"
GraphiQL::Rails.config.initial_query = DEFAULT_QUERY
GraphiQL::Rails.config.title = 'demarches-simplifiees.fr'

View file

@ -3,3 +3,10 @@ GraphQL::RailsLogger.configure do |config|
'API::V2::GraphqlController' => ['execute']
}
end
GraphqlPlayground::Rails.configure do |config|
config.title = "demarches-simplifiees.fr"
config.settings = {
"schema.polling.enable": false
}
end

View file

@ -224,7 +224,7 @@ Rails.application.routes.draw do
#
authenticated :user, lambda { |user| user.administrateur_id && Flipper.enabled?(:administrateur_graphql, user) } do
mount GraphiQL::Rails::Engine, at: "/graphql", graphql_path: "/api/v2/graphql", via: :get
mount GraphqlPlayground::Rails::Engine, at: "/graphql", graphql_path: "/api/v2/graphql"
end
namespace :api do