-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to request EmbeddedDocumentField in query #32
Comments
@atbe : Thanks for the feedback 👍 I think I have covered embedded document query already, you can refer following test case I just finished (and it's merged into master just as well) Ping me if you have any question 😃 |
@atbe: I think I know why your query did not work :( We have to declare class ProfessorMetadata(MongoengineObjectType):
class Meta:
model = ProfessorMetadataModel
class ProfessorVector(MongoengineObjectType):
class Meta:
model = ProfessorVectorModel
class Query(graphene.ObjectType):
professor_vector = graphene.Field(ProfessorVector, id=graphene.String())
def resolve_professor_vector(self, info, id):
print(id)
return ProfessorVectorModel.objects(metadata__id=id).first()
schema = graphene.Schema(query=Query, types=[ProfessorVector]) only that metadata could be resolved. You can say it is by-design or the limitation of |
@abawchen eureka! That looks to be what my issue was. I wasn't aware that I should declare embedded documents, thanks for clearing that up. |
Update GitHub URL in setup.py
Hi,
I have the following models:
And setup a schema like so
And a sample of the object in the database:
However with this setup, I am not able to run the following query in graphiql:
I get the following error:
What's the issue with
EmbeddedDocumentField
? Doesgraphene-mongo
support this kind of embedded document? Any help would be appreciated.Thanks.
The text was updated successfully, but these errors were encountered: