What are some GraphQL schema naming best practices?

I found this graphql API design tutorial from Shopify some time ago. I think there is no explicit chapter but best practice w.r.t. naming convention spread across the tutorial.


I pondered about these same questions and I hope this will be helpful to you.

1. I don't believe that appending Interface at the end of every interface is idiomatic. It is much better to have a descriptive name instead. Consider the example provided in the GraphQL Specification relating to Interfaces. They don't append Interface to any of their types.

2. Enums are only advantageous when there are multiple related values. I don't see how including type is helpful when there is only one possible value. Enum values are also named with all caps and underscores per the GraphQL Specification relating to Enums.

3. If you decided to implement a scalar type then it is up to you to validate the field. In this specific case, providing Point as a type makes the most sense as a Point could be 2-D or 3-D. Defining it as a type is more declarative.

Values such as Date, Email and Url are common examples for scalar types. They provide semantic value and clients will know what to expect from these fields.

Here's the relevant section for custom scalars. Here's an example.

4. You will find this article by Lee Byron helpful.