Skip to content

Instantly share code, notes, and snippets.

final ObjectMapper mapper = new ObjectMapper();
final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(1);
Properties props = new Properties();
props.setProperty(TwitterSource.CONSUMER_KEY, "******************");
props.setProperty(TwitterSource.CONSUMER_SECRET, "*********************");
props.setProperty(TwitterSource.TOKEN, "*******************");
props.setProperty(TwitterSource.TOKEN_SECRET, "*****************");
@Bean
@Singleton
public GraphQL graphQL(
final ResourceResolver resourceResolver,
final DataFetcherProvider dataFetcherProvider) {
val schemaParser = new SchemaParser();
val schemaGenerator = new SchemaGenerator();
// Parse the schema.
compile 'io.micronaut.graphql:micronaut-graphql:1.1.0'
type Link {
url: String!
description: String!
}
type Query {
# a type of query which returns all links
allLinks: [Link!]!
}
native-image \
-H:ReflectionConfigurationFiles=reflection-config.json \
-H:ResourceConfigurationFiles=resources-config.json \
-jar build/libs/bootstrap.jar \
--no-server \
--enable-http --enable-https --enable-url-protocols=http,https \
-Djava.net.preferIPv4Stack=true
console.log (
(function(n: number): number {
if (n < 5) {
return // returns undefined which is not desired. Desired is n*2.
// Can "no statement after return" be checked by TS compiler ?
n * 2;
}
return n;
})(3)
);