FORMAT: 1A HOST: http://farmanimals.apiblueprint.org/
Animals is a simple API allowing consumers to view information about the animals on a farm.
FORMAT: 1A HOST: http://farmanimals.apiblueprint.org/
Animals is a simple API allowing consumers to view information about the animals on a farm.
# Keeper | |
{ | |
id: Long, | |
name: String, | |
animals: Animal[] | |
} | |
# Animal | |
{ | |
id: Long, |
GraphQLObjectType keeperType = newObject() | |
.name("keeper") // required | |
.description("A Zoo Keeper") // optional | |
.field(newFieldDefinition() | |
.name("id") | |
.description("Keeper ID") | |
.type(GraphQLLong) | |
.build()) | |
.field(newFieldDefinition() | |
.name("name") |
schema { | |
query: QueryType | |
} | |
type QueryType { | |
# (id: Long) allows for these fields to be filtered by id | |
animals(id: Long): [Animal] | |
keepers(id : Long) : [Keeper] | |
} |
graphql | |
|---- controller - exposes /v1/graphql POST endpoint | |
|---- executor - picks apart the request and executes the query against the schema | |
|---- schema - builds up the schema and provides it to the executor | |
|---- datafetcher - wraps calls to the database, external APIs, etc |
# retrieve all keepers names and the names of their animals | |
{ | |
"query":"{ keepers { name animals { name } } }" | |
} | |
# retrieve keeper 1's name and their animals' name and birthdate | |
{ | |
"query":"{ keepers(id: 1) { name animals { name birthdate } } }" | |
} |
class PropertyResourceProvider implements SwaggerResourcesProvider { | |
// application.yml props get wired into this config | |
@Autowired | |
private SwaggerServicesConfig config | |
@Override | |
List get() { | |
config.services.collect { svc -> | |
new SwaggerResource( | |
name: svc.name, |
buildscript { | |
dependencies { | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
classpath "com.github.jengelman.gradle.plugins:shadow:$shadow_version" | |
} | |
} | |
plugins { | |
id 'idea' | |
id 'com.palantir.git-version' version '0.5.2' |
connect: | |
image: confluentinc/cp-kafka-connect:latest | |
volumes: | |
- ./build/libs:/usr/share/java/kafka-connect-plugin-name |
@Configuration | |
@ConfigurationProperties(prefix = "kafka") | |
class TopicConfigurations { | |
List<TopicConfiguration> topics; | |
static class TopicConfiguration { | |
String name; | |
Integer numPartitions = 3; | |
Short replicationFactor = 1; | |