thecodingmachine / graphqlite

Use PHP Attributes/Annotations to declare your GraphQL API

Home Page:https://graphqlite.thecodingmachine.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enum not resolved in first level input arguments

l-you opened this issue · comments

commented

Consider such queries that do the same thing - update order status.

Schema

enum OrderState {
	Completed
	Failed
	Processing
}
input OrderInput {
	id: String!
}
input OrderManagementUpdateInput {
	state: OrderState = null
}
type Schema {
  updateShopOrderPrimaryData(
    order: OrderInput!
    update: OrderManagementUpdateInput!
  ): Order!
}

Query 1

mutation updateShopOrderState(
    $orderId: String!
    $state: OrderState!
) {
    updateShopOrderPrimaryData(order: {id: $orderId}, update: {state: $state}) {
        ...DashboardOrderFields
    }
}

Query 2

mutation updateShopOrderPrimaryData(
    $orderId: String!
    $update: OrderManagementUpdateInput!
) {
    updateShopOrderPrimaryData(order: {id: $orderId}, update: $update) {
        ...DashboardOrderFields
    }
}

Actually, issue is that Query 1 throws exception cannot find GraphQL type \"OrderState\". Check your TypeMapper configuration.
Query 2 works just fine when I pass state field in update argument .

Actually its the same queries, but they have different client-side structure.

I tried to make reproduction with tests #535 but it seems issue not so obvious.

commented

Closed this issue because I believe root of problem is the same with #531