Closed andrijan closed 3 years ago
@andrijan:
See the updated example project (the very minimal configuration to have authentication checks working):
./scripts/run_django.sh createsuperuser
docker-compose up
./scripts/populate_elasticsearch_data.sh
./scripts/run_django.sh runserver
Go to http://localhost:8000/admin/ and enter your credentials
Go to http://localhost:8000/graphql and type in the following query:
query PostsQuery {
postDocumentsForUser {
edges {
node {
id
title
userId
}
}
}
}
P. S.
If you have more questions regarding this implementation, take an initiative to dive deeper into the subject (Django/GraphQL/Elasticsearch).
Hey, just found this project, looks really good!
While testing this out on my project (Which currently uses django-elasticsearch-dsl-drf) I wanted to pre-filter the queryset by only selecting the documents the user has access to. But to do that I would need the
request
object.The filter backend in the django-elasticsearch-dsl-drf I currently use (and trying to replicate) looks like this:
Any idea how I could solve it with your project?