Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Issue when the type contains "implements" instruction #6

Closed
Tibiritabara opened this issue Sep 25, 2019 · 3 comments
Closed

Issue when the type contains "implements" instruction #6

Tibiritabara opened this issue Sep 25, 2019 · 3 comments

Comments

@Tibiritabara
Copy link

The issue is the next one: if your type contains an implements, like the ones generated by graphene-django, the library _sdl generation appends the @key("id") suffix before the implements, when it should be present afterwards.

This is caused by the service.py, line 29

for entity_name, entity in custom_entities.items():
        type_def = "type %s" % entity_name
        repl_str = "%s %s " % (type_def, entity._sdl)
        pattern = re.compile(type_def)
        string_schema = pattern.sub(repl_str, string_schema)

As we see on the type_def var, it does not consider the fact that there might be an "implement" or other keywords after the type name.

The solution is quite simple with a regex

@erebus1
Copy link
Collaborator

erebus1 commented Sep 25, 2019

Thanks for reporting!
#7

Seems there is the same issue with @extend
I'll check it a bit later

@Tibiritabara
Copy link
Author

I saw the fix, but it was also hitting auto-generated types by graphene. I just added a space on the regular expression. It is available on: #8

@erebus1
Copy link
Collaborator

erebus1 commented Nov 2, 2019

Seems there is the same issue with @extend
I'll check it a bit later

fixed: #16

@erebus1 erebus1 closed this as completed Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants