Skip to content

Commit

Permalink
feat(decorators): honor flags in CustomField decorator (#428)
Browse files Browse the repository at this point in the history
* feat(decorators): honor flags in CustomField decorator

* fix(test): add back accidentally removed lines
  • Loading branch information
ikoenigsknecht authored Feb 24, 2021
1 parent b464981 commit d74411c
Show file tree
Hide file tree
Showing 29 changed files with 146 additions and 125 deletions.
5 changes: 2 additions & 3 deletions examples/01-simple-model/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,10 @@ export interface BaseModelUUID extends BaseGraphQLObject {
}

export interface PageInfo {
limit: Float
offset: Float
totalCount: Float
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor?: String | null
endCursor?: String | null
}

export interface StandardDeleteResponse {
Expand Down
5 changes: 2 additions & 3 deletions examples/01-simple-model/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ type Mutation {
}

type PageInfo {
limit: Float!
offset: Float!
totalCount: Float!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}

type Query {
Expand Down
10 changes: 5 additions & 5 deletions examples/02-complex-example/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export interface UserCreateInput {
bigIntField?: Float | null
jsonField?: JSONObject | null
jsonFieldNoFilter?: JSONObject | null
stringField?: String | null
stringField: String
noFilterField?: String | null
noSortField?: String | null
noFilterOrSortField?: String | null
Expand Down Expand Up @@ -359,6 +359,7 @@ export interface UserWhereInput {
varcharField_startsWith?: String | null
varcharField_endsWith?: String | null
varcharField_in?: String[] | String | null
geometryField_json?: JSONObject | null
intField_eq?: Int | null
intField_gt?: Int | null
intField_gte?: Int | null
Expand Down Expand Up @@ -470,11 +471,10 @@ export interface BaseModelUUID extends BaseGraphQLObject {
}

export interface PageInfo {
limit: Float
offset: Float
totalCount: Float
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor?: String | null
endCursor?: String | null
}

export interface StandardDeleteResponse {
Expand Down Expand Up @@ -504,7 +504,7 @@ export interface User extends BaseGraphQLObject {
bigIntField?: Int | null
jsonField?: JSONObject | null
jsonFieldNoFilter?: JSONObject | null
stringField?: String | null
stringField: String
noFilterField?: String | null
noSortField?: String | null
noFilterOrSortField?: String | null
Expand Down
7 changes: 5 additions & 2 deletions examples/02-complex-example/generated/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ export class UserWhereInput {
@TypeGraphQLField(() => [String], { nullable: true })
varcharField_in?: string[];

@TypeGraphQLField(() => GraphQLJSONObject, { nullable: true })
geometryField_json?: JsonObject;

@TypeGraphQLField(() => Int, { nullable: true })
intField_eq?: number;

Expand Down Expand Up @@ -784,8 +787,8 @@ export class UserCreateInput {
@TypeGraphQLField(() => GraphQLJSONObject, { nullable: true })
jsonFieldNoFilter?: JsonObject;

@TypeGraphQLField({ nullable: true })
stringField?: string;
@TypeGraphQLField()
stringField!: string;

@TypeGraphQLField({ nullable: true })
noFilterField?: string;
Expand Down
10 changes: 5 additions & 5 deletions examples/02-complex-example/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ type Mutation {
}

type PageInfo {
limit: Float!
offset: Float!
totalCount: Float!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}

type Query {
Expand Down Expand Up @@ -129,7 +128,7 @@ type User implements BaseGraphQLObject {
jsonFieldNoFilter: JSONObject

"""This is a string field"""
stringField: String
stringField: String!
noFilterField: String
noSortField: String
noFilterOrSortField: String
Expand Down Expand Up @@ -172,7 +171,7 @@ input UserCreateInput {
bigIntField: Float
jsonField: JSONObject
jsonFieldNoFilter: JSONObject
stringField: String
stringField: String!
noFilterField: String
noSortField: String
noFilterOrSortField: String
Expand Down Expand Up @@ -449,6 +448,7 @@ input UserWhereInput {
varcharField_startsWith: String
varcharField_endsWith: String
varcharField_in: [String!]
geometryField_json: JSONObject
intField_eq: Int
intField_gt: Int
intField_gte: Int
Expand Down
10 changes: 2 additions & 8 deletions examples/03-one-to-many-relationship/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,10 @@ export interface BaseModelUUID extends BaseGraphQLObject {
}

export interface PageInfo {
limit: Float
offset: Float
totalCount: Float
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor?: String | null
endCursor?: String | null
}

export interface Post extends BaseGraphQLObject {
Expand Down Expand Up @@ -269,11 +268,6 @@ The javascript `Date` as string. Type represents date and time as the ISO Date s
*/
export type DateTime = Date | string

/*
The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
*/
export type Float = number

/*
The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
*/
Expand Down
5 changes: 2 additions & 3 deletions examples/03-one-to-many-relationship/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ type Mutation {
}

type PageInfo {
limit: Float!
offset: Float!
totalCount: Float!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}

type Post implements BaseGraphQLObject {
Expand Down
10 changes: 2 additions & 8 deletions examples/04-many-to-many-relationship/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,10 @@ export interface BaseModelUUID extends BaseGraphQLObject {
}

export interface PageInfo {
limit: Float
offset: Float
totalCount: Float
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor?: String | null
endCursor?: String | null
}

export interface Post extends BaseGraphQLObject {
Expand Down Expand Up @@ -467,11 +466,6 @@ The javascript `Date` as string. Type represents date and time as the ISO Date s
*/
export type DateTime = Date | string

/*
The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
*/
export type Float = number

/*
The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@ type Mutation {
}

type PageInfo {
limit: Float!
offset: Float!
totalCount: Float!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}

type Post implements BaseGraphQLObject {
Expand Down
10 changes: 2 additions & 8 deletions examples/05-migrations/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,10 @@ export interface BaseModelUUID extends BaseGraphQLObject {
}

export interface PageInfo {
limit: Float
offset: Float
totalCount: Float
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor?: String | null
endCursor?: String | null
}

export interface StandardDeleteResponse {
Expand Down Expand Up @@ -206,11 +205,6 @@ The javascript `Date` as string. Type represents date and time as the ISO Date s
*/
export type DateTime = Date | string

/*
The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
*/
export type Float = number

/*
The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
*/
Expand Down
5 changes: 2 additions & 3 deletions examples/05-migrations/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ interface DeleteResponse {
}

type PageInfo {
limit: Float!
offset: Float!
totalCount: Float!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}

type Query {
Expand Down
10 changes: 2 additions & 8 deletions examples/06-base-service/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,10 @@ export interface BaseModelUUID extends BaseGraphQLObject {
}

export interface PageInfo {
limit: Float
offset: Float
totalCount: Float
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor?: String | null
endCursor?: String | null
}

export interface StandardDeleteResponse {
Expand Down Expand Up @@ -200,11 +199,6 @@ The javascript `Date` as string. Type represents date and time as the ISO Date s
*/
export type DateTime = Date | string

/*
The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
*/
export type Float = number

/*
The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
*/
Expand Down
5 changes: 2 additions & 3 deletions examples/06-base-service/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ type Mutation {
}

type PageInfo {
limit: Float!
offset: Float!
totalCount: Float!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}

type Query {
Expand Down
10 changes: 2 additions & 8 deletions examples/07-feature-flags/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,11 +901,10 @@ export interface FeatureFlagUser extends BaseGraphQLObject {
}

export interface PageInfo {
limit: Float
offset: Float
totalCount: Float
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor?: String | null
endCursor?: String | null
}

export interface Project extends BaseGraphQLObject {
Expand Down Expand Up @@ -1000,11 +999,6 @@ The javascript `Date` as string. Type represents date and time as the ISO Date s
*/
export type DateTime = Date | string

/*
The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
*/
export type Float = number

/*
The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
*/
Expand Down
5 changes: 2 additions & 3 deletions examples/07-feature-flags/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,10 @@ type Mutation {
}

type PageInfo {
limit: Float!
offset: Float!
totalCount: Float!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}

type Project implements BaseGraphQLObject {
Expand Down
10 changes: 2 additions & 8 deletions examples/08-performance/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,10 @@ export interface BaseModelUUID extends BaseGraphQLObject {
}

export interface PageInfo {
limit: Float
offset: Float
totalCount: Float
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor?: String | null
endCursor?: String | null
}

export interface Post extends BaseGraphQLObject {
Expand Down Expand Up @@ -272,11 +271,6 @@ The javascript `Date` as string. Type represents date and time as the ISO Date s
*/
export type DateTime = Date | string

/*
The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
*/
export type Float = number

/*
The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
*/
Expand Down
5 changes: 2 additions & 3 deletions examples/08-performance/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ type Mutation {
}

type PageInfo {
limit: Float!
offset: Float!
totalCount: Float!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}

type Post implements BaseGraphQLObject {
Expand Down
10 changes: 2 additions & 8 deletions examples/09-production/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,10 @@ export interface BaseModelUUID extends BaseGraphQLObject {
}

export interface PageInfo {
limit: Float
offset: Float
totalCount: Float
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor?: String | null
endCursor?: String | null
}

export interface Post extends BaseGraphQLObject {
Expand Down Expand Up @@ -270,11 +269,6 @@ The javascript `Date` as string. Type represents date and time as the ISO Date s
*/
export type DateTime = Date | string

/*
The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
*/
export type Float = number

/*
The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
*/
Expand Down
Loading

0 comments on commit d74411c

Please sign in to comment.