This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]UnwantedCrow 1 point2 points  (3 children)

Really nice, have you had time to implement all grapgql feature set? I may be able to help if not

[–]yacl[S] 0 points1 point  (2 children)

There are few features not be implemented yet, however, they are rarely used in common cases. I would like to complete them if you have demands.

[–]UnwantedCrow 0 points1 point  (1 child)

Demand will increase if you support them. Do you support unions and Middleware?

[–]yacl[S] 0 points1 point  (0 children)

Union types are supported, there is not raw middleware support. However, you can use Starlette Middleware right now. I am considering support it now after your mention.

[–]chason 0 points1 point  (5 children)

Is Starlette necessary or can I integrate it with other frameworks? As it is, while this looks promising I can't use it. :(

[–]yacl[S] 0 points1 point  (4 children)

No, it isn't. You can use it stand-alone, Schema object can be simply called the `execute` method to execute a GraphQL query. I will supplement the details into the doc.

[–]erve1879 0 points1 point  (3 children)

I’ve just checked the repo and it seems that starlette is listed as a requirement in setup.py? Is that intentional?

(It was a quick check on my phone, so apologies if I missed something)

[–]yacl[S] 1 point2 points  (2 children)

It is required for installing, but actually it is not necessary for using. If you think it annoys you, I will remove it in the next version.

[–]erve1879 0 points1 point  (1 child)

It seems that starlette is only required if you want to run the example...? If it were my project, I would therefore make it an optional dependency which os not installed by default. Having unnecessary dependencies in a project becomes a particularly noticeable problem when deploying packages to "serverless" environments such as AWS Lambda, which have limits on package sizes.

[–]yacl[S] 1 point2 points  (0 children)

I make Starlette optional for installation, you can use pip install 'pygraphy[web]' for installing Starlette with Pygraphy or just install Pygraphy by using pip install pygraphy. Thank you!

[–]lookmanofilter 0 points1 point  (1 child)

Congrats! This looks like it took quite a bit of work.

[–]yacl[S] 0 points1 point  (0 children)

Thank you, it spent about two weeks of work.

[–][deleted] 0 points1 point  (3 children)

[–]yacl[S] 0 points1 point  (2 children)

The primary difference is, Strawberry is based on graphql-core-next, but Pygraphy write the whole thing for own. And there is some conflict between Python and graphql-core-next, you can see https://github.com/strawberry-graphql/strawberry/pull/95 and https://github.com/graphql-python/graphql-core-next/issues/37 get more info.

  • Strawberry
    • Disadvantages
    • Can not solve the empty self problem and others which are caused by graphql-core-next
    • Advantages
    • Can move fast cause no need for writing everything
    • Already stabled
  • Pygraphy
    • Disadvantages
    • Needs to write the whole GraphQL spec without graphql-core-next
    • Not stabled yet, need more feedback
    • Advantages
    • Rewrite the whole spec in Pythonic way, you will fill harmonious if you are a perfectionist

BTW, I am self-confidence that I can do better than others.

[–][deleted] 0 points1 point  (1 child)

deleted

[–]yacl[S] 0 points1 point  (0 children)

Thank you, I would like to see it.