question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider using less general names in example schemas

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kobylynskyicommented, May 2, 2020
  • @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 to implement Query instead of implement 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 named QueryResolver and all AbcQuery classes to be named AbcQueryResolver 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.

0reactions
joffrey-bioncommented, May 2, 2020

@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.

the resolver interface generated for a regular type Xxx is named XxxResolver (see this line in the code). So now I would vote for renaming Query to QueryResolver for the sake of consistency 😄

In particular, what do you think of this @kobylynskyi ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found