Skip to content

parablesoft/rails-ember-graphql-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

#README

Bootstrapping a new application

Structure

  1. Create a directory within your projects workspace
  2. cd into that directory
  3. git init

Rails

  1. Create the application
rails new api -d postgresql -T -J -G --api
  1. Adjust your database.yml

  2. Create your databases

bin/rails db:create:all
  1. Install stardust_rails - All of the instructions are on the github page.

Add this line to your application's Gemfile:

gem 'stardust_rails', require: 'stardust'

And then execute:

$ bundle

Mount the engine:

# config/routes.rb
Rails.application.routes.draw do
  ...
  mount Stardust::Engine, at: "/"
  ...
end

Ember

  1. Create the application using the new ember octane template
ember new web -b @ember/octane-app-blueprint --no-welcome --skip-npm --skip-bower --skip-git
  1. Install tailwindcss
ember install ember-cli-tailwind
  1. Setup Pods - Add the following key/value pair to the ENV object in web/config/environment.js
podModulePrefix: "web/ui",
  1. Install ember-apollo-client
ember install ember-apollo-client
  1. Configure ember-apollo - Please note, there are additional steps for authentication

In your app's config/environment.js, configure the URL for the GraphQL API.

let ENV = {
  ...
  apollo: {
    apiURL: 'http://localhost:3000',
  },
  ...
}

In your app's ember-cli-build.js, you can set build time options for broccoli-graphql-filter to keep file extensions in .graphql files.

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    emberApolloClient: {
      keepGraphqlFileExtension: true
    }
  });

  return app.toTree();
};

Tools

  1. https://electronjs.org/apps/graphiql A GUI for editing and testing GraphQL queries and mutations

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published