# Neo4j with Apollo v4 and @as-integrations/aws-lambda

**URL:** <https://community.neo4j.com/t/neo4j-with-apollo-v4-and-as-integrations-aws-lambda/58557>\
**Category:** Drivers & Stacks\
**Tags:** migrated, aws-lambda, new-apollov4\
**Created:** [February 1, 2023, 1:40pm UTC](https://community.neo4j.com/t/neo4j-with-apollo-v4-and-as-integrations-aws-lambda/58557 "2023-02-01T13:40:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aymeric](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/aymeric/32/27568_2.png) [@Aymeric](https://community.neo4j.com/u/Aymeric)\
**Post date:** [February 1, 2023, 1:40pm UTC](https://community.neo4j.com/t/neo4j-with-apollo-v4-and-as-integrations-aws-lambda/58557/1 "2023-02-01T13:40:00Z")

</div>

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 :

```auto
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:

```auto
{
    "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 :

```auto
/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 ?

---

<div class="post-metadata">

**Author:** ![LiamDoodson](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/liamdoodson/32/27406_2.png) [@LiamDoodson](https://community.neo4j.com/u/LiamDoodson)\
**Post date:** [February 10, 2023, 4:06pm UTC](https://community.neo4j.com/t/neo4j-with-apollo-v4-and-as-integrations-aws-lambda/58557/2 "2023-02-10T16:06:42Z")

</div>

Hi @Aymeric! I'm afraid this looks like more of a question about using an ApolloServer with `@as-integrations/aws-lambda` so you may have more luck asking in either of those communities.

That being said, it seems as though the query you are making would not be valid for the type definitions you provided. It looks as though you are attempting to query `NodeAymeric` nodes. If this is the case the way to do this with the provided type definitions is as follows:

```plaintext
query {
  nodeAymerics {
    hello
  }
}

```

However, your message suggests you are trying to create a `NodeAymeric` node. This could be achieved with the query below:

```plaintext
mutation {
  createNodeAymerics(input: {hello: "someValue"}) {
    nodeAymerics {
      hello
    }
  }
}

```

I hope this helps!

---

<div class="post-metadata">

**Author:** ![Aymeric](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/aymeric/32/27568_2.png) [@Aymeric](https://community.neo4j.com/u/Aymeric)\
**Post date:** [February 15, 2023, 4:35pm UTC](https://community.neo4j.com/t/neo4j-with-apollo-v4-and-as-integrations-aws-lambda/58557/3 "2023-02-15T16:35:17Z")

</div>

Thank you @LiamDoodson for your feedback.  
Indeed my code could not work.  
Now I better understand type definitions and resolve them.
