Skip to content

Commit

Permalink
Merge pull request #900 from bakaphp/hotfix-module-config-type
Browse files Browse the repository at this point in the history
refact; countri filter
  • Loading branch information
kaioken authored Feb 5, 2024
2 parents e1c58b0 + 67dedfa commit 75dfbfa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
5 changes: 3 additions & 2 deletions graphql/schemas/Ecosystem/city.graphql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extend type Query {
cities(
orderBy: _ @orderBy(columns: ["id", "created_at"])
orderBy: _ @orderBy(columns: ["id", "created_at", "name"])
where: _
@whereConditions(
columns: [
Expand All @@ -12,7 +12,8 @@ extend type Query {
"country_id"
]
)
): [Cities!]! @paginate(model: "Kanvas\\Locations\\Models\\Cities")
): [Cities!]!
@paginate(defaultCount: 25, model: "Kanvas\\Locations\\Models\\Cities")
city(id: Int!): Cities @find(model: "Kanvas\\Locations\\Models\\Cities")
}

Expand Down
14 changes: 6 additions & 8 deletions graphql/schemas/Ecosystem/country.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ type Cities {

extend type Query {
countries(
orderBy: _ @orderBy(columns: ["id", "created_at"])
orderBy: _ @orderBy(columns: ["id", "created_at", "name"])
where: _ @whereConditions(columns: ["name", "code", "flag", "id"])
hasStates: _ @whereHasConditions(columns: ["name"])
hasCities: _ @whereHasConditions(columns: ["name"])
): [Country!]!
@paginate(model: "\\Kanvas\\Locations\\Models\\Countries")
@paginate(
defaultCount: 25
model: "\\Kanvas\\Locations\\Models\\Countries"
)
country(id: Int! @eq): Country
@find(model: "\\Kanvas\\Locations\\Models\\Countries")
}
Expand Down Expand Up @@ -64,12 +67,7 @@ extend type Mutation {
@field(
resolver: "App\\GraphQL\\Ecosystem\\Mutations\\Locations\\CreateCountry"
)
updateCountry(
id: ID!
name: String!
code: String!
flag: String
): Country
updateCountry(id: ID!, name: String!, code: String!, flag: String): Country
@update(model: "\\Kanvas\\Locations\\Models\\Countries")
deleteCountry(id: ID!): Country!
@delete(model: "\\Kanvas\\Locations\\Models\\Countries")
Expand Down
9 changes: 7 additions & 2 deletions graphql/schemas/Ecosystem/states.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ type StateInput {
}
extend type Query {
states(
where: _ @whereConditions(columns: ["name", "code", "id"])
): [States!]! @paginate(model: "\\Kanvas\\Locations\\Models\\States")
where: _
@whereConditions(columns: ["name", "code", "id", "countries_id"])
): [States!]!
@paginate(
defaultCount: 25
model: "\\Kanvas\\Locations\\Models\\States"
)
state(id: Int!): States @find(model: "\\Kanvas\\Locations\\Models\\States")
}

Expand Down

0 comments on commit 75dfbfa

Please sign in to comment.