Skip to content

Commit

Permalink
Unique baz_id
Browse files Browse the repository at this point in the history
  * foo.barId and foo.bazId become non-optional (Int!)
  * The root queries for foo disappear
    - foo(id: Int!) : Foo
    - fooByBarId(barId: Int!): Foo
  * The only root query for foo is now foo(bazId: Int!): Foo
  • Loading branch information
felixyz committed Oct 18, 2020
1 parent 6ddf628 commit 08d3684
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
25 changes: 5 additions & 20 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,8 @@ type Baz implements Node {
id: Int!
name: String

"""Reads and enables pagination through a set of `Foo`."""
foosList(
"""Only read the first `n` values of the set."""
first: Int

"""Skip the first `n` values."""
offset: Int

"""The method to use when ordering `Foo`."""
orderBy: [FoosOrderBy!]

"""
A condition to be used in determining which values should be returned by the collection.
"""
condition: FooCondition
): [Foo!]!
"""Reads a single `Foo` that is related to this `Baz`."""
foo: Foo
}

"""
Expand Down Expand Up @@ -86,8 +72,8 @@ type Foo implements Node {
"""
nodeId: ID!
id: Int!
barId: Int

This comment has been minimized.

Copy link
@felixyz

felixyz Oct 18, 2020

Author Owner

Not expected

bazId: Int
barId: Int!
bazId: Int!

"""Reads a single `Bar` that is related to this `Foo`."""
bar: Bar
Expand Down Expand Up @@ -202,8 +188,7 @@ type Query implements Node {
): [Foo!]
bar(id: Int!): Bar
baz(id: Int!): Baz
foo(id: Int!): Foo

This comment has been minimized.

Copy link
@felixyz

felixyz Oct 18, 2020

Author Owner

Not expected

fooByBarId(barId: Int!): Foo
foo(bazId: Int!): Foo

"""Reads a single `Bar` using its globally unique `ID`."""
barByNodeId(
Expand Down
3 changes: 2 additions & 1 deletion schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ comment on view gql.baz is '@primaryKey id';
comment on view gql.foo is '@primaryKey id
@foreignKey (bar_id) references bar (id)
@foreignKey (baz_id) references baz (id)
@unique bar_id';
@unique bar_id
@unique baz_id';

0 comments on commit 08d3684

Please sign in to comment.