overblog / GraphQLBundle

This bundle provides tools to build a complete GraphQL API server in your Symfony App.
MIT License
783 stars 221 forks source link

Quick start guide does not explain what is actually happening behind the scenes #609

Open kix opened 4 years ago

kix commented 4 years ago
Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? no
Version/Branch 0.12.3

Could be duplicate of #285, although that issue has been closed since with no visible improvement.

The quick start guide mentions setting a query to a value of Query, although this renders the application unusable with this exception:

 "message": "Could not found type with alias \"Query\". Do you forget to define it?",
 "class": "Overblog\\GraphQLBundle\\Resolver\\UnresolvableException",

An explanation of what the Query means exactly would be very helpful in the documentation.

mcg-web commented 4 years ago

Yes I agree this part of the documentation is not totally clear. This issue came with flex since it was not allowed adding demo files, so we could not add a demo Query type file. Adding a type Query should fix this.

akomm commented 4 years ago

@kix is this just a feedback or do you actually want to know the answer for this? Just in case the later matters:

The config overblog_graphql.definitions.schema allows you to define multiple graphql endpoints, each with its own schema & mutation types: https://github.com/overblog/GraphQLBundle/blob/master/docs/definitions/schema.md#multiple-schema-endpoint As you can seei n the example there are multiple query grouped by the endpoint key. IN your example you do not have the key, so its a single endpoint mode.

Meaning of query: Query that for query the type named Query is used. This type named Query must be available in your type mapping, whatever method you use (annotation. yaml, ...).

kix commented 4 years ago

Well, I've already figured out how this all is set up by looking at examples, but I think the doc would still benefit from having a direct and concise explanation on the core concepts.

akomm commented 4 years ago

Yes. I know, if you are new to this its confusing because the information is sometimes actually there, but at different topic and might be just there as a side-effect, not to actually explain it...

kix commented 4 years ago

My concern here is that for a quick start, you usually want to have a working basic setup of the library quick and easy. I've figured thus out, but I'm hoping to add some docs on the matter, so I'll try to make a PR for that.

lostfocus commented 1 year ago

Frankly I'm still not sure what to do to get things going