You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note:` for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.
What is the current behavior?
the following implementation of to_global_id fails after upgrading graphene to v3
fromgrapheneimport (
Field,
String,
Int,
ObjectType,
relay,
ID,
List,
NonNull,
Date,
Boolean,
)
fromgraphene.relay.nodeimportto_global_idclassSubmittedContent(ObjectType):
global_id=ID(description="The global ID of the submitted content.")
db_id=Int()
name=String(description="The name of the submitted content.")
type=String(description="The type of the submitted content.")
submitted_by=String(description="The name of the user who submitted the content.")
status=String(description="The status of the submitted content.")
defresolve_global_id(root, info):
ifroot.get("type") in [
DocumentTypes.FORM_RESULT.value,
DocumentTypes.SITE_DIARY.value,
DocumentTypes.DIGITAL_DOCKET.value,
DocumentTypes.TIMESHEET.value,
]:
doc_type=root.get("type")
ifDocumentTypes(doc_type) ==DocumentTypes.SITE_DIARY:
doc_type="SiteDiary"returnto_global_id(root.get("type"), root["db_id"])
returnNone
this ends up in
cannot import name 'to_global_id' from 'graphene.relay.node'
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
a github repo, https://repl.it or similar.
What is the expected behavior?
The to_global_id function should serialize the global id
What is the motivation / use case for changing the behavior?
Many people uses the relay framework and plan to upgrade from v2 to v3, there is no documantation on this breaking changes
Please tell us about your environment:
Version: 2.16.0 --> 3.0.0
Platform: python 3.9.5
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
As a work around changing the imports fixes the problem.
fromgraphql_relayimportto_global_id
The text was updated successfully, but these errors were encountered:
Note:` for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.
the following implementation of
to_global_id
fails after upgrading graphene to v3this ends up in
cannot import name 'to_global_id' from 'graphene.relay.node'
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
a github repo, https://repl.it or similar.
What is the expected behavior?
The
to_global_id
function should serialize the global idWhat is the motivation / use case for changing the behavior?
Many people uses the relay framework and plan to upgrade from v2 to v3, there is no documantation on this breaking changes
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
As a work around changing the imports fixes the problem.
The text was updated successfully, but these errors were encountered: