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
Trying to get a pyramid / sqlalchemy / graphene server to work with a Relay example: relay modern todo example
but am receiving an error when running a mutation (queries work fine):
GraphQLError('Unknown type "RenameTodoInput".',)
relevant schema:
class Todo(SQLAlchemyObjectType):
class Meta:
model = TodoModel
interfaces = (relay.Node, )
class RenameTodo(relay.ClientIDMutation):
class Input:
text = graphene.String(description='Text', required=True)
id = graphene.Int(description='Todo Id', required=True)
todo = graphene.Field(Todo)
ok = graphene.Boolean()
@staticmethod
def mutate_and_get_payload(root, args, context, info):
todo_id = args.get('id')
todoModel = Todo.get_query(context).first()
todoModel.text = args.get('text')
todo = Todo(todoModel)
ok = True
return RenameTodo(todo=todo, ok=ok)
class Mutations(graphene.ObjectType):
renameTodo = RenameTodo.Field()
the Relay mutation:
const mutation = graphql`
mutation RenameTodoMutation($input: RenameTodoInput!) {
renameTodo(input:$input) {
todo {
id
text
}
}
}
`;
the actual request: {"query":"mutation RenameTodoMutation(\n $input: RenameTodoInput!\n) {\n renameTodo(input: $input) {\n todo {\n id\n text\n }\n }\n}\n","variables":{"input":{"text":"Do something","id":"QmVlcjox"}}}
schema.introspect() seems to indicate that the type is being created:
Hi @jimshepherd . We're currently going through old issues that appear to have gone stale (ie. not updated in about the last 6 months) to try and clean up the issue tracker. If this is still important to you please comment and we'll re-open this.
Trying to get a pyramid / sqlalchemy / graphene server to work with a Relay example:
relay modern todo example
but am receiving an error when running a mutation (queries work fine):
GraphQLError('Unknown type "RenameTodoInput".',)
relevant schema:
the Relay mutation:
the actual request:
{"query":"mutation RenameTodoMutation(\n $input: RenameTodoInput!\n) {\n renameTodo(input: $input) {\n todo {\n id\n text\n }\n }\n}\n","variables":{"input":{"text":"Do something","id":"QmVlcjox"}}}
schema.introspect() seems to indicate that the type is being created:
I have tried creating a custom RenameTodoInput class, but still received the same error.
Versions:
graphene (1.4.1)
graphene-sqlalchemy (1.1.1)
graphql-core (1.1)
graphql-relay (0.4.5)
Any help is appreciated.
The text was updated successfully, but these errors were encountered: