File tree Expand file tree Collapse file tree 1 file changed +0
-153
lines changed Expand file tree Collapse file tree 1 file changed +0
-153
lines changed Original file line number Diff line number Diff line change @@ -425,156 +425,3 @@ xdescribe('Test buildTypeWeightsFromSchema function', () => {
425425 } ) ;
426426 } ) ;
427427} ) ;
428-
429- /**
430- * Here is the schema that creates the followning typeWeightsObject used for the tests
431- *
432- type Query {
433- hero(episode: Episode): Character
434- reviews(episode: Episode!, first: Int): [Review]
435- search(text: String): [SearchResult]
436- character(id: ID!): Character
437- droid(id: ID!): Droid
438- human(id: ID!): Human
439- }
440-
441- enum Episode {
442- NEWHOPE
443- EMPIRE
444- JEDI
445- }
446-
447- interface Character {
448- id: ID!
449- name: String!
450- friends: [Character]
451- appearsIn: [Episode]!
452- }
453-
454- type Human implements Character {
455- id: ID!
456- name: String!
457- homePlanet: String
458- friends: [Character]
459- appearsIn: [Episode]!
460- }
461-
462- type Droid implements Character {
463- id: ID!
464- name: String!
465- friends: [Character]
466- primaryFunction: String
467- appearsIn: [Episode]!
468- }
469-
470- type Review {
471- episode: Episode
472- stars: Int!
473- commentary: String
474- }
475-
476- union SearchResult = Human | Droid
477-
478- type Scalars {
479- num: Int,
480- id: ID,
481- float: Float,
482- bool: Boolean,
483- string: String
484- test: Test,
485- }
486-
487- type Test {
488- name: String,
489- variable: Scalars
490- }
491- type Topic {
492- relatedTopics(first: Int): [Topic]
493- name: String
494- }
495- *
496- * TODO: extend this schema to include mutations, subscriptions and pagination
497- *
498- type Mutation {
499- createReview(episode: Episode, review: ReviewInput!): Review
500- }
501- type Subscription {
502- reviewAdded(episode: Episode): Review
503- }
504- type FriendsConnection {
505- totalCount: Int
506- edges: [FriendsEdge]
507- friends: [Character]
508- pageInfo: PageInfo!
509- }
510- type FriendsEdge {
511- cursor: ID!
512- node: Character
513- }
514- type PageInfo {
515- startCursor: ID
516- endCursor: ID
517- hasNextPage: Boolean!
518- }
519-
520- add
521- friendsConnection(first: Int, after: ID): FriendsConnection!
522- to character, human and droid
523- */
524- const typeWeights : TypeWeightObject = {
525- query : {
526- // object type
527- weight : 1 ,
528- fields : { } ,
529- } ,
530- episode : {
531- // enum
532- weight : 0 ,
533- fields : { } ,
534- } ,
535- human : {
536- // implements an interface
537- weight : 1 ,
538- fields : {
539- id : 0 ,
540- name : 0 ,
541- homePlanet : 0 ,
542- } ,
543- } ,
544- droid : {
545- // implements an interface
546- weight : 1 ,
547- fields : {
548- id : 0 ,
549- name : 0 ,
550- } ,
551- } ,
552- review : {
553- weight : 1 ,
554- fields : {
555- stars : 0 ,
556- commentary : 0 ,
557- } ,
558- } ,
559- searchResult : {
560- // union type
561- weight : 1 ,
562- fields : { } ,
563- } ,
564- scalars : {
565- weight : 1 ,
566- fields : {
567- num : 0 ,
568- id : 0 ,
569- float : 0 ,
570- bool : 0 ,
571- string : 0 ,
572- } ,
573- } ,
574- test : {
575- weight : 1 ,
576- fields : {
577- name : 0 ,
578- } ,
579- } ,
580- } ;
You can’t perform that action at this time.
0 commit comments