This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
GraphQLObjectType, GraphQLList, GraphQLString, GraphQLInt, GraphQLBoolean, | |
} from 'graphql' | |
import {attributeFields, resolver} from 'graphql-sequelize'; | |
import db from '../../models' | |
module.exports = modelName => modelRelationFunc => { | |
const relationMethods = { | |
listOf: (gqlRelationType, options={}) => ({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Hyr.Command do | |
@moduledoc """ | |
Define a command struct and an associated GraphQL mutation. | |
## Example | |
defmodule Hyr.Shifts.Opening.Commands.CancelOpeningEmployer do | |
use Hyr.Command | |
alias Hyr.Shifts.Opening.Schema.Opening |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as AbsintheSocket from "@absinthe/socket"; | |
import {Socket as PhoenixSocket} from "phoenix"; | |
import {createFetcher, createSubscriber} from "@absinthe/socket-relay"; | |
let instance = null | |
const errorFun = error => console.warn(error) | |
export default class RelayEnvironmentService { | |
static init(params) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fetch = require('node-fetch'); | |
var fs = require('fs'); | |
const { | |
buildClientSchema, | |
introspectionQuery, | |
printSchema, | |
} = require('graphql/utilities'); | |
console.log(introspectionQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In each Command module | |
defmodule Hyr.Shifts.Opening.Commands.CancelOpening do | |
use Hyr.Commanded | |
input_object :cancel_opening_input_object do | |
field :opening_id, non_null(:id) | |
field :employer_id, non_null(:id) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[info] Sent 200 in 354ms | |
[debug] INCOMING "doc" on "__absinthe__:control" to Absinthe.Phoenix.Channel | |
Transport: Phoenix.Transports.WebSocket | |
Parameters: %{"query" => "subscription { newOpening {\n spots\n \temployerId\n \tsiteId\n }\n}", "variables" => nil} | |
[debug] ABSINTHE schema=Hyrbak.Schema variables=nil | |
--- | |
subscription { newOpening { | |
spots | |
employerId | |
siteId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule BlogPhoenix.Context do | |
@moduledoc """ | |
This module is just a regular plug that can look at the conn struct and build | |
the appropriate absinthe context. | |
""" | |
@behaviour Plug | |
import Plug.Conn | |
def init(opts), do: opts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(FunctionClauseError) no function clause matching in Absinthe.Resolution.Projector.project/5 | |
(absinthe) lib/absinthe/resolution/projector.ex:5: Absinthe.Resolution.Projector.project([%Absinthe.Blueprint.Document.Field{alias: nil, argument_data: %{}, arguments: [], complexity: nil, directives: [], errors: [], flags: %{}, name: "__typename", schema_node: %Absinthe.Type.Field{__private__: [], __reference__: nil, args: %{}, complexity: nil, default_value: nil, deprecation: nil, description: "The name of the object type currently being queried.", identifier: nil, middleware: [{{Absinthe.Resolution, :call}, #Function<0.862031/2 in Absinthe.Introspection.Field.meta/1>}], name: "__typename", type: :string}, selections: [], source_location: %Absinthe.Blueprint.Document.SourceLocation{column: nil, line: 3}, type_conditions: []}], nil, [%Absinthe.Blueprint.Document.Field{alias: nil, argument_data: %{id: "U2hpZnQ6MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjU1NDQwMDAw"}, arguments: [%Absinthe.Blueprint.Input.Argument{er |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
View, | |
Image, | |
ListView, | |
ScrollView, | |
Text, | |
TouchableHighlight, | |
TouchableNativeFeedback, | |
TouchableOpacity, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { TextInput, View } from 'react-native' | |
import theme from './theme' | |
const Input = (props) => ( | |
const styles = { | |
inlineWrapper: { | |
flex: inlineLabel ? .5 : 1, | |
height: inlineLabel ? theme.FormGroup.height - theme.FormGroup.borderWidth*2 : theme.FormGroup.height, |
NewerOlder