Skip to content

Documentation Issues #632

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

Closed
changeling opened this issue May 11, 2019 · 12 comments
Closed

Documentation Issues #632

changeling opened this issue May 11, 2019 · 12 comments

Comments

@changeling
Copy link
Contributor

changeling commented May 11, 2019

There seem to be quite a few issues in the docs. Just ran into these:

In http://docs.graphene-python.org/projects/django/en/latest/queries/, under Full example at the top:

    questions = graphene.List(QuestionType)
    question = graphene.Field(Question, question_id=graphene.String())

Should read:

    questions = graphene.List(QuestionType)
    question = graphene.Field(QuestionType, question_id=graphene.String())

At the bottom, again under Full Example in the Relay section:

class QuestionType(DjangoObjectType):
    class Meta:
        model = Question
        interaces = (relay.Node,)

Should read:

class QuestionType(DjangoObjectType):
    class Meta:
        model = Question
        interfaces = (relay.Node,)

Perhaps this issue (or does one exist already?) would be a good place to encourage folks to post specific issues in the Documentation?

If these are still present when I have more time, I'll fix these two in a PR, but that might be several days.

@changeling
Copy link
Contributor Author

Additionally, the Relay section Full example seems to indicate that resolvers are not necessary. Is that correct, and I'm completely missing something?

In any case, the example doesn't seem to work unless something like the following, at least, is added:

    def resolve_questions(self, info, **kwargs):
        return Question.objects.all()

The Full example currently reads:

from graphene import relay
from graphene_django import DjangoObjectType
from .models import Question


class QuestionType(DjangoObjectType):
    class Meta:
        model = Question
        interaces = (relay.Node,)


class QuestionConnection(relay.Connection):
    class Meta:
        node = QuestionType


class Query:
    question = graphene.Field(QuestionType)
    questions = relay.ConnectionField(QuestionConnection)

@phalt
Copy link
Contributor

phalt commented May 12, 2019

Hey @changeling thanks for finding these. I am re-writing the docs currently, and the parts you've highlighted are new and clearly missed a thorough review. I'll make a PR when I get back next week (unless you want to!) and we can merge the fixes.

@changeling
Copy link
Contributor Author

Hey, @phalt, glad to help out. I've submitted a PR with these fixes, with a note regarding the Relay Full example. My resolvers are rudimentary, and should probably be extended a little to implement filtering.

@changeling
Copy link
Contributor Author

changeling commented May 13, 2019

Oh, and also, @phalt, I've added a simple beginning for a FAQ on the graphene page. See if you think this might be valuable. The wiki page here on graphene-django is disabled.:

https://github.com/graphql-python/graphene/wiki/FAQ

@phalt
Copy link
Contributor

phalt commented May 13, 2019

@changeling
Copy link
Contributor Author

@phalt, yep! Thanks! Any thoughts on this approach?

@phalt
Copy link
Contributor

phalt commented May 13, 2019

@changeling organically adding stuff there that can't be added to docs is something I'm okay with. Wikis are meant to be fluid. And anything we really like we can solidify into the official docs.

@changeling
Copy link
Contributor Author

@changeling organically adding stuff there that can't be added to docs is something I'm okay with. Wikis are meant to be fluid.

Great. I'm a fan of 'em. It also allows a broader community to point out issues they struggle with, and solutions found. In my experience, this tends to evolve them towards best practices.

And anything we really like we can solidify into the official docs.

That's exactly my thinking.

@changeling
Copy link
Contributor Author

changeling commented May 13, 2019

@phalt, I spoke to soon. I had checked that the wiki was now active, but didn't check for open editing. I see your initial page, but editing is still disabled. Apologies for the incomplete test, as it were.

Zorig added a commit to Zorig/graphene-django that referenced this issue May 15, 2019
@phalt
Copy link
Contributor

phalt commented May 15, 2019

@changeling working on it, I should have admin rights for the project so let me try sort it.

@phalt
Copy link
Contributor

phalt commented May 15, 2019

@changeling sorted, go wild! (with moderation 😆 )

@phalt phalt closed this as completed May 15, 2019
@changeling
Copy link
Contributor Author

Great! Going wild(-ish)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants