• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

profusion / sgqlc / 81
100%

Build:
DEFAULT BRANCH: master
Ran 14 Jan 2020 01:46AM UTC
Jobs 1
Files 11
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
81

push

travis-ci-com

barbieri
codegen: use lazy-reference if a field type is shadowed by a sibling

https://docs.python.org/3.8/tutorial/classes.html#class-definition-syntax
https://python-textbok.readthedocs.io/en/1.0/Variables_and_Scope.html

See note:

  The inside of a class body is also a new local variable
  scope. Variables which are defined in the class body (but outside
  any class method) are called class attributes. They can be
  referenced by their bare names within the same scope, [...]

Or in code example:

```py
name = 1

class C:
   name = 2
   value = name

print(C.value) # 2
```

In most GraphQL Schema this is not an issue since types follow
`TitleCase`, however with Hasura it uses all lower case names.

In the given example at #82 we can see:

```py
class country(sgqlc.types.Type):
    __schema__ = rx_schema
    id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name='id')
    name = sgqlc.types.Field(sgqlc.types.non_null(bpchar), graphql_name='name')

class query_root(sgqlc.types.Type):
    ...

    country_by_pk = sgqlc.types.Field(country, graphql_name='country_by_pk', args=sgqlc.types.ArgDict((
        ('id', sgqlc.types.Arg(sgqlc.types.non_null(Int), graphql_name='id', default=None)),
))
    )
```

Leads to the crash since `country` is not a `Type`, rather it's a `Field`.

Closes: #82

1376 of 1376 relevant lines covered (100.0%)

1.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 81.1 14 Jan 2020 01:46AM UTC 0
100.0
Travis Job 81.1
Source Files on build 81
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #81
  • 9323d521 on github
  • Prev Build on master (#113)
  • Next Build on master (#114)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc