How to write better graphql schemas?

Hey Johri,

You see, the probability of a user making an error is higher than that of a computer, right? You started this thread talking about building a GraphQL Schema. You didn’t quite explain what you’re doing, but based on what you’ve written, it seems you might be mixing things up. You seem to be confusing DQL Schema with GraphQL. These are two distinct things. However, from your last post, it seems you’re improving in DQL and modeling following the GraphQL standard. I’m a bit confused as to why you’re writing DQL Schemas if you’re working with GraphQL. But let’s unpack this.

The “@filter(eq(name, $a))” part shouldn’t work if your model is the last one you presented. If it did work, you might have done something wrong. Perhaps you didn’t delete previous data or didn’t start the database from scratch.

Let’s agree on the following. Start from absolute zero. Delete everything (of course, if it’s not sensitive data). And stick to one model. Don’t use “name”, always use “User.name” and don’t change that. Update any mutations if you still have any in that format. It’s actually good if you use this model because it will make your data compatible with GraphQL, if you gonna use it in the future, and improve the overall performance of the Cluster.

But understand, if it worked without “User.”, it means you’re doing something wrong. And it’s likely because you forgot to clean the database.

Once you’ve given this a try, I’d be curious to hear how it worked out for you. So, let me know! And of course, feel free to ask if you have any more questions. I’m here to help!

Cheers.