Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-01-2023 05:40 AM
Hello friends.
Do you know integrate the new ApolloServer V4 with package integration of AWS (@as-integrations/aws-lambda) and Neo4j ?
I have try to execute in my lambda this code :
import { ApolloServer } from '@apollo/server';
import { startServerAndCreateLambdaHandler } from '@as-integrations/aws-lambda';
import DatabaseManage from '../services/database/DatabaseManage';
import { Neo4jGraphQL} from '@neo4j/graphql'
const typeDefs = `#graphql
type NodeAymeric {
hello: String
}
`;
const resolvers = {
NodeAymeric: {
hello: () => 'world',
},
};
const driver = DatabaseManage.driver ;
const neoShema = new Neo4jGraphQL({
typeDefs,
resolvers,
driver})
const initServer = async () => {
return await neoShema.getSchema().then((schema) => {
const server = new ApolloServer({
schema,
});
return server;
});
};
export const handler = async () => {
const serverHandler = await initServer();
return startServerAndCreateLambdaHandler(serverHandler)
};
My query.json:
{
"version": "2",
"httpMethod": "POST",
"path": "/",
"headers": {
"content-type": "application/json"
},
"requestContext": {},
"rawQueryString": "",
"body": "{\"operationName\": null, \"variables\": null, \"NodeAymeric\": \"{ hello }\"}"
}
When I invoke the function with serverless :
/user/me$ serverless invoke local -f function-create-nodeAymeric -p ./Request/query.json
I have : "undefined" and my node (NodeAymeric) is not created in data base.
Do you have an idea ?
All the sessions of the conference are now available online