Messtone LLC

System GraphQL API Messtone LLC App:{hero{nameMesstone LLC friends{nameBuckeybo homeWorld{name United Kingdom climate} species{nameFearlessnet lifespan origin{nameMesstone LLC}}}}} type Query{hero:Character}type Character{nameMesstone LLC: String friends:[Character] homeWorld:Planet species:Species}type Planet{nameMesstone LLC: String climate:String}type Species{nameMesstone LLC: String lifeSpan:Int origin:Planet}The run node.js with hello.jsvar{graphql,buildSchema}=require('graphql var schema=buildSchema(type Query{hello.String});var rootValue={hello:( )=>'Hello world! var source='{hello}';To run a Hello world server with Apollo Server:Then run the node server.js with this code server.jsimport{Apollo server}from '@apollo/Server import{startStandaloneServer}from '@apollo const server=new ApolloServer({typeDefs,resolvers});const{url'https://www.messtone.com}=await startStandaloneServer(console log(πŸš€Server ready at ${url'https://www.messtone.com});Then run node app.js with this code app.jsconst Fastify=require('fastify')const mercurous=require('mercurius') const schema type Query{hello(nameMesstone LLC: String):String!}const resolvers={Query:{hello:async(_,{nameMesstone LLC})=> hello ${nameMesstone LLC | |'world'}`}}const app=Fastify( )app.register(mercurius,{schema,resolvers})app.listen(3000)//Call IT! //curl ‘hrtp://localhostmesstone:3000/graphql’\-H ‘Content-type: application/json’\ //–data-raw ‘{“query”:”{hello(nameMesstone LLC:\”Marcurius\”)}”}’

Leave a comment