Layne  Fadel

Layne Fadel

1651582800

Graphitejs: Framework NodeJS For GraphQL.

Framework NodeJS for GraphQl

GraphiteJS is a NODE.JS Framework for building GraphQL schemas/types fast, easily and with scalability.

  • Easy to use: GraphiteJS make easy GraphQL in NodeJS without effort.
  • Any Front: GraphiteJS support any front library.
  • Data agnostic: GraphiteJS supports any kind of data source.

Install


npm i @graphite/server --save

yarn add @graphite/server

on your index file:


import { Graphite } from '@graphite/server'

main = async () => {
  const graphite = await Graphite()
}

main()

and that's all, you have running the graphqli tool on the port 4000 by default.

How to use

After install @graphite/server you have to create your first model. We recommend creating a folder called models and follow the pattern matching the filename with the Type name.

Types


import { GraphQL } from '@graphite/server'

export const Developer = GraphQL('Developer')({
   // the value always have to be an array first arg is the type, the second arg is an optional comment
  name: ['String!', 'Your name is required'],
  age: ['Int'],
  isGreatDeveloper: ['Boolean']
})

So, now you need to pass this model to the Graphite Server

on index.js


import { Graphite } from '@graphite/server'
import { Developer } from './models/Developer'

main = async () => {
  await Graphite({ models: [Developer] })
}

main()

Queries


import { GraphQL } from '@graphite/server'

export const Developer = GraphQL('Developer')({
  name: ['String!', 'Your name is required'],
  age: ['Int'],
  isGreatDeveloper: ['Boolean'],

  Query: {
    'developer: Developer': () => ({ name: 'Your name' }),
    'developers: [Developer]': () => ([{ name: 'Your name' }]),
  }
})

Mutations


import { GraphQL } from '@graphite/server'

export const Developer = GraphQL('Developer')({
  name: ['String!', 'Your name is required'],

  Mutation: {
    'createDeveloper(name: String): Developer': (_, { name, }) => ({ name }),
    'updateDeveloper(id: ID!, name: String): Developer': (_, { name }) => ({ name }),
    'removeDeveloper(id: ID!): Developer': (_, { name }) => ({ name }),
  },
})

Subscriptions


import { GraphQL, PubSub } from '@graphite/server'

const pubsub = new PubSub()
const DEVELOPER_ADDED = 'DEVELOPER_ADDED'

export const Developer = GraphQL('Developer')({
  name: ['String!', 'Your name is required'],

  Mutation: {
    'createDeveloper(name: String): Developer': (_, { name, }) => { 
      pubsub.publish(DEVELOPER_ADDED, { developerAdded: { name } })
      return { name }
    },
  },

  Subscription: {
    'developerAdded: Developer': {
      subscribe: () => pubsub.asyncIterator([DEVELOPER_ADDED]),
    },
  },
})

Relations


  // models/Repository.js
  const Repository = GraphQL('Repository')({
      name: ['String'],
      url: ['String'],
  })

  // models/GithubProfile.js
  const GithubProfile = GraphQL('GithubProfile')({
      url: ['String'],
  })

  // models/Developer.js
  const Developer = GraphQL('Developer')({
    name: ['String'],

    'respositories: [Repository]': () => [{ name: 'GraphiteJS', url: 'https://github.com/graphitejs/graphitejs' }],

    'githubProfile: GithubProfile': () => ({ url: 'https://github.com/wzalazar' }),

    Query: {
      'developer: Developer': () => ({ name: 'Walter Zalazar' }),
    },
  })

So, now you need to pass this model to the Graphite Server

on index.js


import { Graphite } from '@graphite/server'
import { Developer } from './models/Developer'
import { Repository } from './models/Repository'
import { GithubProfile } from './models/GithubProfile'

main = async () => {
  await Graphite({ models: [Developer, Repository, GithubProfile] })
}

main()

Contributing

Please see our contributing.md

  • Clone this repository.
  • Install dependencies.

npm install
  • Feel free for pull request.

Author: graphitejs
Source Code: https://github.com/graphitejs/server
License: MIT License
#nodejs #graphql 

What is GEEK

Buddha Community

Graphitejs: Framework NodeJS For GraphQL.

Hire NodeJs Developer

Looking to build dynamic, extensively featured, and full-fledged web applications?

Hire NodeJs Developer to create a real-time, faster, and scalable application to accelerate your business. At HourlyDeveloper.io, we have a team of expert Node.JS developers, who have experience in working with Bootstrap, HTML5, & CSS, and also hold the knowledge of the most advanced frameworks and platforms.

Contact our experts: https://bit.ly/3hUdppS

#hire nodejs developer #nodejs developer #nodejs development company #nodejs development services #nodejs development #nodejs

Layne  Fadel

Layne Fadel

1651582800

Graphitejs: Framework NodeJS For GraphQL.

Framework NodeJS for GraphQl

GraphiteJS is a NODE.JS Framework for building GraphQL schemas/types fast, easily and with scalability.

  • Easy to use: GraphiteJS make easy GraphQL in NodeJS without effort.
  • Any Front: GraphiteJS support any front library.
  • Data agnostic: GraphiteJS supports any kind of data source.

Install


npm i @graphite/server --save

yarn add @graphite/server

on your index file:


import { Graphite } from '@graphite/server'

main = async () => {
  const graphite = await Graphite()
}

main()

and that's all, you have running the graphqli tool on the port 4000 by default.

How to use

After install @graphite/server you have to create your first model. We recommend creating a folder called models and follow the pattern matching the filename with the Type name.

Types


import { GraphQL } from '@graphite/server'

export const Developer = GraphQL('Developer')({
   // the value always have to be an array first arg is the type, the second arg is an optional comment
  name: ['String!', 'Your name is required'],
  age: ['Int'],
  isGreatDeveloper: ['Boolean']
})

So, now you need to pass this model to the Graphite Server

on index.js


import { Graphite } from '@graphite/server'
import { Developer } from './models/Developer'

main = async () => {
  await Graphite({ models: [Developer] })
}

main()

Queries


import { GraphQL } from '@graphite/server'

export const Developer = GraphQL('Developer')({
  name: ['String!', 'Your name is required'],
  age: ['Int'],
  isGreatDeveloper: ['Boolean'],

  Query: {
    'developer: Developer': () => ({ name: 'Your name' }),
    'developers: [Developer]': () => ([{ name: 'Your name' }]),
  }
})

Mutations


import { GraphQL } from '@graphite/server'

export const Developer = GraphQL('Developer')({
  name: ['String!', 'Your name is required'],

  Mutation: {
    'createDeveloper(name: String): Developer': (_, { name, }) => ({ name }),
    'updateDeveloper(id: ID!, name: String): Developer': (_, { name }) => ({ name }),
    'removeDeveloper(id: ID!): Developer': (_, { name }) => ({ name }),
  },
})

Subscriptions


import { GraphQL, PubSub } from '@graphite/server'

const pubsub = new PubSub()
const DEVELOPER_ADDED = 'DEVELOPER_ADDED'

export const Developer = GraphQL('Developer')({
  name: ['String!', 'Your name is required'],

  Mutation: {
    'createDeveloper(name: String): Developer': (_, { name, }) => { 
      pubsub.publish(DEVELOPER_ADDED, { developerAdded: { name } })
      return { name }
    },
  },

  Subscription: {
    'developerAdded: Developer': {
      subscribe: () => pubsub.asyncIterator([DEVELOPER_ADDED]),
    },
  },
})

Relations


  // models/Repository.js
  const Repository = GraphQL('Repository')({
      name: ['String'],
      url: ['String'],
  })

  // models/GithubProfile.js
  const GithubProfile = GraphQL('GithubProfile')({
      url: ['String'],
  })

  // models/Developer.js
  const Developer = GraphQL('Developer')({
    name: ['String'],

    'respositories: [Repository]': () => [{ name: 'GraphiteJS', url: 'https://github.com/graphitejs/graphitejs' }],

    'githubProfile: GithubProfile': () => ({ url: 'https://github.com/wzalazar' }),

    Query: {
      'developer: Developer': () => ({ name: 'Walter Zalazar' }),
    },
  })

So, now you need to pass this model to the Graphite Server

on index.js


import { Graphite } from '@graphite/server'
import { Developer } from './models/Developer'
import { Repository } from './models/Repository'
import { GithubProfile } from './models/GithubProfile'

main = async () => {
  await Graphite({ models: [Developer, Repository, GithubProfile] })
}

main()

Contributing

Please see our contributing.md

  • Clone this repository.
  • Install dependencies.

npm install
  • Feel free for pull request.

Author: graphitejs
Source Code: https://github.com/graphitejs/server
License: MIT License
#nodejs #graphql 

Jillian  Corwin

Jillian Corwin

1648501200

Graphitejs: Framework NodeJS for GraphQL.

Framework NodeJS for GraphQl

GraphiteJS is a NODE.JS Framework for building GraphQL schemas/types fast, easily and with scalability.

  • Easy to use: GraphiteJS make easy GraphQL in NodeJS without effort.
  • Any Front: GraphiteJS support any front library.
  • Data agnostic: GraphiteJS supports any kind of data source.

Install


npm i @graphite/server --save

yarn add @graphite/server

on your index file:


import { Graphite } from '@graphite/server'

main = async () => {
  const graphite = await Graphite()
}

main()

and that's all, you have running the graphqli tool on the port 4000 by default.

How to use

After install @graphite/server you have to create your first model. We recommend creating a folder called models and follow the pattern matching the filename with the Type name.

Types


import { GraphQL } from '@graphite/server'

export const Developer = GraphQL('Developer')({
   // the value always have to be an array first arg is the type, the second arg is an optional comment
  name: ['String!', 'Your name is required'],
  age: ['Int'],
  isGreatDeveloper: ['Boolean']
})

So, now you need to pass this model to the Graphite Server

on index.js


import { Graphite } from '@graphite/server'
import { Developer } from './models/Developer'

main = async () => {
  await Graphite({ models: [Developer] })
}

main()

Queries


import { GraphQL } from '@graphite/server'

export const Developer = GraphQL('Developer')({
  name: ['String!', 'Your name is required'],
  age: ['Int'],
  isGreatDeveloper: ['Boolean'],

  Query: {
    'developer: Developer': () => ({ name: 'Your name' }),
    'developers: [Developer]': () => ([{ name: 'Your name' }]),
  }
})

Mutations


import { GraphQL } from '@graphite/server'

export const Developer = GraphQL('Developer')({
  name: ['String!', 'Your name is required'],

  Mutation: {
    'createDeveloper(name: String): Developer': (_, { name, }) => ({ name }),
    'updateDeveloper(id: ID!, name: String): Developer': (_, { name }) => ({ name }),
    'removeDeveloper(id: ID!): Developer': (_, { name }) => ({ name }),
  },
})

Subscriptions


import { GraphQL, PubSub } from '@graphite/server'

const pubsub = new PubSub()
const DEVELOPER_ADDED = 'DEVELOPER_ADDED'

export const Developer = GraphQL('Developer')({
  name: ['String!', 'Your name is required'],

  Mutation: {
    'createDeveloper(name: String): Developer': (_, { name, }) => { 
      pubsub.publish(DEVELOPER_ADDED, { developerAdded: { name } })
      return { name }
    },
  },

  Subscription: {
    'developerAdded: Developer': {
      subscribe: () => pubsub.asyncIterator([DEVELOPER_ADDED]),
    },
  },
})

Relations


  // models/Repository.js
  const Repository = GraphQL('Repository')({
      name: ['String'],
      url: ['String'],
  })

  // models/GithubProfile.js
  const GithubProfile = GraphQL('GithubProfile')({
      url: ['String'],
  })

  // models/Developer.js
  const Developer = GraphQL('Developer')({
    name: ['String'],

    'respositories: [Repository]': () => [{ name: 'GraphiteJS', url: 'https://github.com/graphitejs/graphitejs' }],

    'githubProfile: GithubProfile': () => ({ url: 'https://github.com/wzalazar' }),

    Query: {
      'developer: Developer': () => ({ name: 'Walter Zalazar' }),
    },
  })

So, now you need to pass this model to the Graphite Server

on index.js


import { Graphite } from '@graphite/server'
import { Developer } from './models/Developer'
import { Repository } from './models/Repository'
import { GithubProfile } from './models/GithubProfile'

main = async () => {
  await Graphite({ models: [Developer, Repository, GithubProfile] })
}

main()

Contributing

Please see our contributing.md

  • Clone this repository.
  • Install dependencies.

npm install
  • Feel free for pull request.

Author: graphitejs
Source Code: https://github.com/graphitejs/server
License: MIT License

#graphql #nodejs 

How to Install NodeJS on Ubuntu 19.04

Overview
In this tutorial, you will learn how to install Node onto Ubuntu 19.04 Disco Dingo. We will cover installation from the default repositories and, for those wanting more recent releases, how to install from the NodeSource repositories.

Installing from Ubuntu
The Ubuntu 19.04 Disco Dingo repository includes NodeJS version 10.15. Like most packages found here, it certainly is not the most recent release; however, if stability is more important than features, it will be your preferred choice.

#nodejs #nodejs 10.x #nodejs 11.x #nodejs 12.x #nodejs 8.x

Best Android Mobile App Development Frameworks

Are you looking for the best Android app development frameworks? Get the best Android app development frameworks that help to build the top-notch Android mobile app.

For more info:
Website: https://www.appcluesinfotech.com/
Email: info@appcluesinfotech.com
Call: +1-978-309-9910

#best android mobile app development frameworks #top mobile app development frameworks #android app development frameworks #top frameworks for android app development #most popular android app development frameworks #app development frameworks