prisma-labs/graphqlgen

check args of query at port 4000 is no I expect.

huang12zheng opened this issue · 3 comments

Description

When I checked the input parameters on port 4000, I found that they were not what I expected.In detail, it is "[Object: null prototype] { _id: 'aa' }",while I expect is "{ _id: 'aa' }"

Steps to reproduce

1.Go to 4000
2.input

query {
queryHash(where: {_id:"aa"}){
_id
query
}
}

3.check in terminal.

the vaule of args

Expected results

{ _id: 'aa' }

Actual results

[Object: null prototype] { _id: 'aa' }

Versions

  • graphqlgen:0.6.0-rc2
  • prisma: 1.26.4
  • OS name and version: ubuntu 16.10

some addtional:

  • 4000:
    query {
    queryHash(where: {_id:"aa"}){
    _id
    query
    }
    }
  • schema:
    type Query {
    queryHash(where: QueryHashWhereInput!): QueryHash!
    }

export interface QueryHashWhereInput {
_id?: string | null
...............
}

  • resolvers:
    queryHash: async (parent, args, ctx) => {
    console.dir(args.where);
    }

datamodel
type QueryHash {
_id: ID! @id
query: String
}

make args to a pritty will solve problem,like below
const a =JSON.parse(JSON.stringify(args));

close with no reply