Skip to content

Fields - pascalCase vs. CamelCase #209

@joemcbride

Description

@joemcbride

Hello, I'm the original creator and maintainer of the GraphQL for .NET project. I have originally setup the project to serialize all fields as camelCase since that is my preference and seemingly idiomatic JavaScript/GraphQL. In the .NET world however there can be strong preference for PascalCase even in your returned JSON structure.

That being said, I know the spec specifically points out that a Name is case-sensitive. My question is, if I change my project to allow case-sensitive fields, which fields still need to be camelCase to conform to the spec?

These seem to be required to be camelCase

  • data
  • errors, with a lowercase message, locations, line and column

Ones I'm unsure about - all the fields related to introspection (and that are on introspection types), such as

  • name, description, args, type, isDeprecated, deprecationReason, defaultValue, etc.
  • __schema, __typename, __type, etc.

Are there others that I'm missing?

What do I need to ensure is camelCase to conform to the spec? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions