This file contains hidden or 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
# app/graphql/types/review_type.rb | |
Types::ReviewType = GraphQL::ObjectType.define do | |
name "Review" | |
field :id, types.ID | |
field :content, types.String | |
end |
This file contains hidden or 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
# app/graphql/types/mutation_type.rb | |
Types::MutationType = GraphQL::ObjectType.define do | |
name "Mutation" | |
field :createMovie, Types::MovieType do | |
argument :title, !types.String | |
argument :description, !types.String | |
resolve -> (obj, args, ctx) { |
This file contains hidden or 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
Types::QueryType = GraphQL::ObjectType.define do | |
name “Query” | |
# Add root-level fields here. | |
# They will be entry points for queries on your schema. | |
field :allMovies do | |
type types[Types::MovieType] | |
description “A list of all the movies” | |
resolve -> (obj, args, ctx) { | |
Movie.all |
This file contains hidden or 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 the app/graphql/types/movie_type.rb file | |
Types::MovieType = GraphQL::ObjectType.define do | |
name “Movie” | |
field :id, !types.ID | |
field :title, !types.String | |
field :description, types.String | |
end |
This file contains hidden or 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
Movie.create( | |
title: ‘Deadly Weapon’, | |
description: ‘2 retired monks walk into a bar’ | |
) | |
Movie.create( | |
title: ‘Deadly Weapon 2 — This time time it’s personal’, | |
description: ‘Like Deadly Weapon, only deadlier and more personal’ | |
) |
This file contains hidden or 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
let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in | |
ParseMutableClientConfiguration.applicationId = "" | |
ParseMutableClientConfiguration.clientKey = "" | |
ParseMutableClientConfiguration.server = "" | |
}) | |
Parse.initializeWithConfiguration(parseConfiguration) |
This file contains hidden or 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
func requestFingerprintAuthentication() { | |
let context = LAContext() | |
var authError: NSError? | |
let authenticationReason: String = "To display a message to the user" | |
if context.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, error: &authError) { | |
context.evaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, localizedReason: authenticationReason, reply: { | |
(success: Bool, error: NSError?) -> Void in | |
if success { | |
self.updateMessageLabel("Woohoo") |
This file contains hidden or 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
func requestFingerprintAuthentication() { | |
let context = LAContext() | |
var authError: NSError? | |
let authenticationReason: String = "To display a message to the user" | |
if context.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, error: &authError) { | |
context.evaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, localizedReason: authenticationReason, reply: { | |
(success: Bool, error: NSError?) -> Void in | |
if success { | |
dispatch_async(dispatch_get_main_queue(), { |
This file contains hidden or 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
func requestFingerprintAuthentication() { | |
let context = LAContext() | |
var authError: NSError? | |
let authenticationReason: String = "To display a message to the user" | |
if context.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, error: &authError) { | |
} | |
} |
This file contains hidden or 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
func requestFingerprintAuthentication() { | |
let context = LAContext() | |
var authError: NSError? | |
let authenticationReason: String = "To display a message to the user" | |
} |