graphql-python / graphql-python/graphene
Is it possible to dynamically create InputObjectType objects ?
- Langage dominant
- Python
- Étoiles
- 8.2k
- Forks
- 818
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
My problem: I have a method foo that takes an InputObjectType as input and does some logic, from those InputObjectType, I need to create, dynamically in the backend, other InputObjectType that will also be passed to the foo method.
When I try to create the InputObjectType, I get a type String is not json serializable error.
Is what am saying possible ? or should refactor my foo method to take dicts or something else ?
```python
def foo(input: SomeInputObjectType):
some_logic(input.some_attribute)
def mutate(..., input1):
# I want to create object input2 that can be passed to the foo method along with input1
# input2 = InputObjectType(...)
foo(input1)
foo(input2)
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par le comportement de InputObjectType de Graphene et les points d’entrée foo et mutate présentés dans l’issue. Reproduisez l’erreur String is not JSON serializable avec l’input créé dynamiquement proposé, puis déterminez si la construction est prise en charge ou si la limite foo doit accepter une autre représentation. Le travail est considéré comme terminé lorsque l’approche prise en charge ou le refactoring requis est documenté et vérifié.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- api, backend-api-design
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100