Note: This guide applies to the project created by quasar-cli.
First install typescript and ts-loaderpackages in your project.
npm i -D typescript ts-loaderThen modified the quasar.conf.js file in your project:
| <!-- | |
| If you really like to use apolloClient declaratively, here is a naive implementation | |
| of a custom 'ApolloQuery' component | |
| --> | |
| <template> | |
| <div> | |
| <slot name="result" :result="this.result" /> | |
| </div> | |
| </template> |
Note: This guide applies to the project created by quasar-cli.
First install typescript and ts-loaderpackages in your project.
npm i -D typescript ts-loaderThen modified the quasar.conf.js file in your project:
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="description" content="<%= name %> GraphQL documentation"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
| <title><%= title || name %></title> | |
| <% | |
| def relative_filename_path(opts) |
| # frozen_string_literal: true | |
| module Types | |
| class BaseConnection < BaseObject | |
| # For some reason these are needed, they call through to the underlying connection wrapper. | |
| extend Forwardable | |
| def_delegators :@object, :cursor_from_node, :parent | |
| # When this class is extended, add the default connection behaviors. | |
| # This adds a new `graphql_name` and description, and searches |
| require 'strscan' | |
| class Parser | |
| def initialize string | |
| @scanner = StringScanner.new string | |
| end | |
| def self.eval string | |
| self.new(string).expr |
| $('form .input.array').each(function() { | |
| var $wrapper = $('.array-inputs', this); | |
| var $insertArea = $(".array-input button[data-action=add]").closest(".array-input"); | |
| $(".array-input button[data-action=add]", $(this)).click(function(e) { | |
| $('.array-input:first-child', $wrapper).clone(true).insertBefore($insertArea).find('input').val('').focus(); | |
| }); | |
| $('.array-input button[data-action=remove]', $wrapper).click(function() { | |
| if ($('.array-input', $wrapper).length > 2) { | |
| $(this).parent('.array-input').remove(); | |
| } |
| const webpack = require('webpack') | |
| const { environment } = require('@rails/webpacker') | |
| // Don't use commons chunk for server_side_render chunk | |
| const entries = environment.toWebpackConfig().entry | |
| const commonsChunkEligible = Object.keys(entries).filter(name => name !== 'server_side_render') | |
| environment.plugins.set('CommonsChunkVendor', new webpack.optimize.CommonsChunkPlugin({ | |
| name: 'vendor', | |
| minChunks: (module, count) => { |
| class CustomScrubber < Loofah::Scrubber | |
| ALLOWED_IFRAME_ATTRS = %w[allowfullscreen frameborder height src width].freeze | |
| ALLOWED_VIDEO_REGEX = %r{\A(?:https?:)?//(?:www\.)?youtube|vimeo(?:-nocookie)?\.com/} | |
| def scrub(node) | |
| if node.name == 'iframe' && node['src'] =~ ALLOWED_VIDEO_REGEX | |
| node.attribute_nodes.each { |a| a.remove unless ALLOWED_IFRAME_ATTRS.include?(a.name) } | |
| return CONTINUE | |
| end | |
| return CONTINUE if html5lib_sanitize(node) == CONTINUE |
| type IBuilder<T> = { | |
| [k in keyof T]: (arg: T[k]) => IBuilder<T> | |
| } & { build(): T } | |
| function proxyBuilder<T>(): IBuilder<T> { | |
| var built: any = {}; | |
| var builder = new Proxy({}, { | |
| get: function(target, prop, receiver) { | |
| if (prop === 'build') return () => built; | |
| return (x: any): any => { |
| # frozen_string_literal: true | |
| class AssociationLoader < GraphQL::Batch::Loader | |
| attr_reader :klass, :association | |
| def initialize(klass, association) | |
| raise ArgumentError, "association to load must be a symbol (got #{association.inspect})" unless association.is_a?(Symbol) | |
| raise ArgumentError, "cannot load associations for class #{klass.name}" unless klass < ActiveRecord::Base | |
| raise TypeError, "association #{association} does not exist on #{klass.name}" unless klass.reflect_on_association(association) | |
| @klass = klass |