Skip to content

Commit

Permalink
Fix gql schema, Add static doc generator config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Premwoik committed Nov 9, 2021
1 parent 23a373b commit 19d7a2f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
8 changes: 5 additions & 3 deletions priv/graphql/api_schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type Mutation {
user: UserMutation
}


"""
Contains all admin available queries.
Only authenticated admin can execute this queries.
Expand All @@ -39,19 +38,22 @@ type AdminMutation{
disableDomain(domain: String!): Domain
}


"""
Contains all user available queries.
Only authenticated user can execute this queries.
"""
type UserQuery{
"Something to not leave type without fields"
field: String
}

"""
Contains all user available mutations.
Only authenticated user can execute this mutations.
"""
type UserMutation{
"Something to not leave type without fields"
field: String
}

"""
Expand All @@ -64,7 +66,7 @@ type Domain{
"Domain hostType"
hostType: String
"Is domain enabled?"
enabled: Bool
enabled: Boolean
}

"A result of domain removal"
Expand Down
21 changes: 21 additions & 0 deletions priv/graphql/spectaql_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#Config file needed to generate static documentation from GraphQL using SpectaQL

introspection:
#url: http://localhost:5551/api/graphql
schemaFile: ./priv/graphql/api_schema.gql

info:
title: MongooseIM GraphQL API Reference
description: A static documentation of the MongooseIM GraphQL API
contact:
name: API Support
url: https://github.com/esl/MongooseIM
email: mongoose-im@erlang-solutions.com
license:
name: GPL-2.0
url: https://github.com/esl/MongooseIM/blob/master/COPYING

servers:
- url: http://localhost:5551/api/graphql
description: Dev mim1
production: false
2 changes: 1 addition & 1 deletion priv/graphql/wsite/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
function graphQLFetcher(graphQLParams, opts = {headers: {}}) {
// This example expects a GraphQL server at the path /graphql.
// Change this to point wherever you host your GraphQL server.
return fetch('/graphql-api/', {
return fetch('/api/graphql/', {
method: 'post',
headers: Object.assign({
'Accept': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion rel/files/mongooseim.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

[[listen.http.handlers.mongoose_graphql_cowboy_handler]]
host = "_"
path = "/graphql-api"
path = "/api/graphql"
username = "admin"
password = "secret"

Expand Down

0 comments on commit 19d7a2f

Please sign in to comment.