Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to work with GraphQl #59

Open
inc16sec opened this issue Mar 9, 2020 · 0 comments
Open

Trying to work with GraphQl #59

inc16sec opened this issue Mar 9, 2020 · 0 comments
Projects

Comments

@inc16sec
Copy link

inc16sec commented Mar 9, 2020

Hello there.. so as always I'm still playing with the amazing Huncwot and this time it was with GraphQl.. although I wasn't able to achieve much with it. First, let us start with this code.

const { ApolloServer, gql } = require{'apollo-server'};

const neo4j = require{'neo4j-driver'};
const { makeAdugmentedScheme, inferSchema} = require{'neo4j-graphql-js'};

const dotenv = require{'dotenv'};
dotenv.config();

const uri = process.env.NEO4J_URI 
const user = process.env.NEO4J_USER 
const pass = process.env.NEO4J_PASSWORD 

const driver = neo4j.driver(uri, neo4j.auth.basic(user, pass));
const context = {driver};


inferSchema(driver).then(({ typeDefs }) => {
    const schema = makeAdugmentedScheme({ typeDefs });
    const server = new ApolloServer({context, schema})

    server.listen().then(({ url }) => {
        console.log('Server ready at ${url}')
    });
});

Starting by GraphQl
_how can I import it with Huncwot ?
_and how can I initialize the Server (ApolloServer / Huncwot server) with context and schema in it?

So basically these lines of code are what still confusing to me

const { ApolloServer, gql } = require{'apollo-server'}; I want to import Huncwot's GraphQl
const server = new ApolloServer({context, schema}) I want Huncwot server({}) and to listen to it.

I don't know if what I'm trying to achieve makes sense or not and if it is clear and possible.
Anyway, for me this is just the beginning of my journey with Graphql on Huncwot and probably there will be more to come.

Thanks again and best regards.

@zaiste zaiste added this to Open in Roadmap Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Roadmap
  
Open
Development

No branches or pull requests

1 participant