Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutation Name for Definitions has the In suffix #23

Open
MorganHuegel opened this issue Nov 14, 2018 · 2 comments
Open

Mutation Name for Definitions has the In suffix #23

MorganHuegel opened this issue Nov 14, 2018 · 2 comments

Comments

@MorganHuegel
Copy link
Contributor

Most of the Mutation names are outputted in this format

type Mutation {
   TypeName(input: TypeNameIn): String
}

For Mutations that are from a schema's Definitions, they are outputted with the In suffix

type Mutation {
   DefintionTypeNameIn(input: DefinitionTypeNameIn): String
}

This schema is a good testcase

{
  "id": "https://example.com/food.schema.json",
  "type": "object",
  "properties": {
    "fruits": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "vegetables": {
      "type": "array",
      "items": { "$ref": "#/definitions/veggie" }
    }
  },
  "definitions": {
    "veggie": {
      "type": "object",
      "required": [ "veggieName", "veggieLike" ],
      "properties": {
        "veggieName": {
          "type": "string",
          "description": "The name of the vegetable."
        },
        "veggieLike": {
          "type": "boolean",
          "description": "Do I like this vegetable?"
        }
      }
    }
  }
}

type Mutation output

type Mutation {
  DefinitionVeggieIn(input: DefinitionVeggieIn): String
  Food(input: FoodIn): String
}
@mdlavin
Copy link
Member

mdlavin commented Nov 14, 2018

@AugustinLF I think that @MorganHuegel has a good point about removing the trailing In from definitions. What do you think about it being changed to:

type Mutation {
  DefinitionVeggie(input: DefinitionVeggieIn): String
  Food(input: FoodIn): String
}

@AugustinLF
Copy link
Contributor

Seems good to me, what I'm working on (even if it's paused right now) don't use the mutations^^ But yes, since there won't be any conflicts, I'm good with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants