# Party Schema
GraphQL at its core is asking a server for fields of an object. In the case of the VPD service, this object is a party. The fields of the party are exposed through the schema of the party type. Depending on the business needs of your request, you can request some or all of the fields of the party.
# Model
The top level for any query is the party type. The schema has the following definition:
party {
// The eConnectId of the party
id: String
// The party type
type: String
// The identifiers of the party
partyIds: String[]
// The legal name of the party
legalName: String
// The trade names of the party
tradeNames: String[]
// The sector codes of the party
sectorCodes: String[]
// The locations of the party
locations: PartyLocation[]
// The website of the party
website: String
}
All fields are either string, or string array, except the locations. These are of type PartyLocation, which has the following fields:
PartyLocation {
// The type of the location
type: String
// The address of the location
address: String
// The postcode of the location
postcode: String
// The city of the location
city: String
// The country of the location
country: String
//The latitude of the location
latitude: Float
// The longitude of the location
longitude: Float
}
Any of these fields can be queries in a request. It is recommended to only query the fields you actually need.
An example query requesting all fields on the party object would look as such:
{
party {
id
type
partyIds
legalName
tradeNames
sectorCodes
website
locations {
type
address
postcode
city
country
longitude
latitude
}
}
}
# Arguments
When requesting party information you can add search parameters. These parameters can be added as arguments. The following arguments are accepted:
// Search party by identifier- e.g. a KvK number: "54441587"
id: String
// Search party by name
name: String
// Search party by postcode of a location
postcode: String
// Search party by city of a location
city: String
// Search party by country of a location
country: String
// Search by trying to match any field
search: String
// Maximum number of results - defaults to 10
maxResults: Int = 10
An example query where we only want the legal name and website of eConnect could look like this:
{
party(name:"eConnect", postcode:"3447GW") {
legalName
website
}
}