Consider using less general names in example schemas
See original GitHub issueI was looking at the example QueriesResolver
and saw that it implemented Query
from io.github.kobylynskyi
. I wasn’t sure what this class was or why I’d need to implement it. Then I think I figured out that it’s probably being generated from the schema which has a query of type Query
. Perhaps we could call this ProductQuery
to make it clearer that it’s specific to the example schema and not something general that every resolver needs to implement?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
5 Database Design Schema Example: Critical Practices ...
This blog talks about the Database Schemas & their types, Database Design Schema Example followed by the best practices to attain high ...
Read more >What are database schemas? 5 minute guide with examples
Learn the basics of database schemas with common examples: PostgreSQL, NoSQL, ... Think of a database schema as a type of data structure....
Read more >10 Rules for a Better SQL Schema - Sisense
We recommend using pluralized names for tables (e.g. packages), and pluralizing both words in the name of a join table (e.g. packages_users). Singular...
Read more >Documentation: 15: 5.9. Schemas - PostgreSQL
To create a schema, use the CREATE SCHEMA command. Give the schema a name of your choice. For example: CREATE SCHEMA myschema;.
Read more >Schema design best practices | Cloud Bigtable Documentation
The following general concepts apply to Bigtable schema design: ... can be represented as domain names, consider using a reverse domain name (for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@benmccann generic
Query
class (having all queries) is generated because somebody can have a pretty small schema with 5-7 queries and it might make sense toimplement Query
instead ofimplement FirstQuery, SecondQuery, ThirdQuery, FourthQuery, etc
. It is up to the client to decide which way to go, that’s why we are generating both.I think it is a pretty good idea to have
Query
class to be namedQueryResolver
and allAbcQuery
classes to be namedAbcQueryResolver
classes. But with such minor “improvement” we could brake client implementation. So if we do this, I would agree with @joffrey-bion and introduce config options for configuring prefix/suffix for generated apps. Created #136 for this.@benmccann, @joffrey-bion, Thanks for bringing this up. Closing the issue.
@benmccann no problem, you raise good points that are useful to consider 😉
I will let @kobylynskyi take a look at this and close as he pleases. He’s the maintainer of the repo and may have a different opinion about this.
In particular, what do you think of this @kobylynskyi ?