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

Scalar types #30

Closed
sgomanf opened this issue Jun 7, 2018 · 6 comments
Closed

Scalar types #30

sgomanf opened this issue Jun 7, 2018 · 6 comments

Comments

@sgomanf
Copy link

sgomanf commented Jun 7, 2018

I have a question; I have the following scheme:

scalar qq

type Liquid {
nliquid: Int
fecha: qq
}

type Query {
liquidaciones: [Liquid]
}
why when sending the query

{
liquidaciones{
nliquid
fecha
}
}
get the next result

{
"data": {
"liquidaciones": [
{
"nliquid": 1,
"fecha": "2004-11-16T03:00:00.000Z",
},
{
"nliquid": 2,
"fecha": "2004-12-13T03:00:00.000Z",
"descrip": "NOVIEMBRE 2004"
}
}

without having defined the scalar qq, even changing qq for any other text (other than Int, String, Float or ID)

@cschroeter
Copy link

What exactly is the question here?

@sgomanf
Copy link
Author

sgomanf commented Jun 8, 2018

Is there any predefined resolver for the Date type?. The following entity is returned by the Liquid Resolver

@entity()
export class Liquid {
@PrimaryColumn() nliquid: number;
@column('datetime') fecha: Date;
}

No Resolver was defined for the Scalar qq

@cschroeter
Copy link

cschroeter commented Jun 8, 2018

Date is not a scalar. You will have to define somewhere in your *.graphql schemas

# The DateTime scalar type represents a DateTime. The DateTime is serialized as an RFC 3339 quoted string.
scalar Date

You can find more information about scalars in the NestJS documentation

@sgomanf
Copy link
Author

sgomanf commented Jun 8, 2018

Yes, I know, that's why this question arises because if I define
Scalar Date or Scalar qq or Scalar whatever and then I associate it with the field "fecha" without defining a resolver for this scalar I always get the same result.

@cschroeter
Copy link

This could be a caching problem or some kind of configuration issue. If you can provide an example repository where this error occurs, I can have a look at it.

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants