Add more fields to api.yml

This commit is contained in:
Alberto Miedes Garcés
2017-01-09 14:11:51 +01:00
parent b0bd30e3d1
commit 6940b90260
6 changed files with 17 additions and 3 deletions

View File

@@ -1,7 +1,10 @@
User:
fields:
id: integer
username: string
id: integer
username: string
debates: [Debate]
proposals: [Proposal]
comments: [Comment]
Voter:
fields:
gender: string
@@ -24,6 +27,7 @@ Debate:
geozone: Geozone
comments: [Comment]
public_author: User
votes: [Vote]
Proposal:
fields:
id: integer
@@ -45,6 +49,7 @@ Proposal:
comments: [Comment]
proposal_notifications: [ProposalNotification]
public_author: User
votes: [Vote]
Comment:
fields:
id: integer
@@ -58,6 +63,7 @@ Comment:
ancestry: string
confidence_score: integer
public_author: User
votes: [Vote]
Geozone:
fields:
id: integer

View File

@@ -9,7 +9,7 @@ QueryType = query_type_creator.create
ConsulSchema = GraphQL::Schema.define do
query QueryType
max_depth 10
max_depth 12
resolve_type -> (object, ctx) do
type_name = object.class.name # look up types by class name