Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

ugurcandede/MongoDB-GraphQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


GraphQL MongoDB Server

GraphQL MongoDB Server

GraphQL ve MongoDB Kullanan Örnek Uygulama.


GraphQL ve MongoDB kullanılarak oluşturulmuş örnek bir uygulama. Mutation, Query ve Subscription parametreleri çalışmaktadır.

Projenin Hazırlanması

  1. Projeyi cihazınıza kopyalayın: git clone https://github.com/ugurcandede/MongoDB-GraphQL
  2. Proje dizinine gidin: cd MongoDB-GraphQL.
  3. yarn veya npm install komutu ile gerekli kütüphaneleri indirin.
  4. .env dosyası oluşturup içerisine aşağıdaki gibi MongoDB adresini ve çalışmak istediğiniz PORT numarasını yazın.
  mongoURI=mongodb://localhost:27017/graphql
  PORT=7856
  1. yarn start veya yarn serve komutu ile projeyi çalıştırın.
  2. Proje http://localhost:7856/playground adresinde çalışır halde olacaktır.

Örnek Komutlar

Yeni Kullanıcı Oluşturma

mutation {
  createUser(
    user: {
      name: "Ugurcan Dede"
      email: "[email protected]"
      password: "123456789"
    }
  ) {
    _id
    name
    password
    email
  }
}

Gerçek Zamanlı Yeni Kayıt Olan Kullanıcıları Listeleme

subscription {
  user {
    _id
    name
    email
  }
}

Oluşturulmuş Bütün Gönderileri Listeleme

{
  posts {
    _id
    title
    body
    published
    author {
      name
      email
    }
    date {
      published
      updated
    }
  }
}

Lisans

Proje MIT Lisansına Sahiptir , Copyright (c) 2021 Ugurcan Dede.

About

GraphQL ve MongoDB Kullanan Örnek Uygulama

Topics

Resources

Stars

Watchers

Forks