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
//This code is needed to support recursion | |
_fixture.Behaviors.OfType<ThrowingRecursionBehavior>().ToList() | |
.ForEach(b => _fixture.Behaviors.Remove(b)); | |
_fixture.Behaviors.Add(new OmitOnRecursionBehavior(1)); |
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
public class Person { | |
List<Person> Friends { get; set;} | |
} |
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
_fixture.Customizations.Add( | |
new TypeRelay( | |
typeof(Animal), | |
typeof(Dog))); | |
_fixture.Customizations.Add( | |
new TypeRelay( | |
typeof(Animal), | |
typeof(Cat))); |
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
_fixture.Register<Animal>(() => null); |
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
_fixture.Customizations.Add( | |
new TypeRelay( | |
typeof(Animal), | |
typeof(Dog))); | |
_fixture.Customizations.Add( | |
new TypeRelay( | |
typeof(Animal), | |
typeof(Cat))); |
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 {Injectable} from '@angular/core'; | |
import {ApolloLink, Observable} from 'apollo-link'; | |
import {Apollo} from 'apollo-angular'; | |
import {HttpLink} from 'apollo-angular-link-http'; | |
import {withClientState} from 'apollo-link-state'; | |
import {onError} from 'apollo-link-error'; | |
import {InMemoryCache} from 'apollo-cache-inmemory'; | |
import {PresetConfig} from './types'; |
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
constructor(apollo: Apollo, httpLink: HttpLink, oAuthService: OAuthService) { | |
apollo.create({ | |
link: httpLink.create({ | |
uri: environment.graphqlurl, | |
headers: new HttpHeaders({ | |
authorization: oAuthService.getAccessToken() | |
}), | |
withCredentials: true | |
}), | |
cache |
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
{ | |
provide: APOLLO_OPTIONS, | |
useFactory(httpLink: HttpLink) { | |
return { | |
cache, // InMemoryCache with custom fragment matcher | |
link: httpLink.create({ | |
uri: environment.targetsugraphqlurl | |
}) | |
}; | |
}, |
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 introspectionResult from '../introspection-result'; | |
const fragmentMatcher = new IntrospectionFragmentMatcher({ | |
introspectionQueryResultData: introspectionResult | |
}); | |
const cache = new InMemoryCache({ | |
fragmentMatcher |
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
./src/introspection-result.ts: | |
plugins: | |
- fragment-matcher |