Elixir Absinthe Relay using non_null on connection node_type

200 views Asked by At

Any idea why I would get this error on:

connection(node_type: non_null(:thing), non_null: true)
== Compilation error in file lib/app/things/types.ex ==
** (Protocol.UndefinedError) protocol String.Chars not implemented for {:non_null, [line: 7], [:thing]} of type Tuple. This protocol is implemented for the following type(s): Geo.Polygon, Geo.PointZ, Geo.PolygonZ, Geo.MultiLineStringZ, Geo.MultiPoint, Geo.GeometryCollection, Geo.MultiPointZ, Geo.PointZM, Geo.LineStringZ, Geo.Point, Geo.MultiPolygonZ, Geo.MultiPolygon, Geo.LineString, Geo.PointM, Geo.MultiLineString, Postgrex.Copy, Postgrex.Query, Decimal, Float, DateTime, Time, List, Version.Requirement, Atom, Integer, Version, Date, BitString, NaiveDateTime, URI
    (elixir 1.10.4) lib/string/chars.ex:3: String.Chars.impl_for!/1
    (elixir 1.10.4) lib/string/chars.ex:22: String.Chars.to_string/1
    (absinthe_relay 1.5.0) lib/absinthe/relay/connection/notation.ex:58: Absinthe.Relay.Connection.Notation.Naming.ident/2
    (absinthe_relay 1.5.0) lib/absinthe/relay/connection/notation.ex:44: Absinthe.Relay.Connection.Notation.Naming.from_attrs!/1
    (absinthe_relay 1.5.0) expanding macro: Absinthe.Relay.Connection.Notation.connection/1
1

There are 1 answers

2
atomkirk On

If you add an identitifer, then it works:

connection(:thing, node_type: non_null(:thing), non_null: true)